/** * * @see Ai1ec_Connector_Plugin::render_tab_content() * */ public function render_tab_content() { global $ai1ec_view_helper; $this->render_opening_div_of_tab(); $file_input = Ai1ec_Helper_Factory::create_input_instance(); $file_input->set_type('file'); $file_input->set_id(self::NAME_OF_FILE_INPUT); $file_input->set_name(self::NAME_OF_FILE_INPUT); $submit = Ai1ec_Helper_Factory::create_input_instance(); $submit->set_type('submit'); $submit->add_class('button-primary'); $submit->set_name(self::NAME_OF_SUBMIT); $submit->set_id(self::NAME_OF_SUBMIT); $submit->set_value(__('Submit Events', AI1EC_PLUGIN_NAME)); $textarea = Ai1ec_Helper_Factory::create_generic_html_tag('textarea'); $textarea->set_attribute('name', self::NAME_OF_TEXTAREA); $textarea->set_attribute('rows', 6); $textarea->set_id(self::NAME_OF_TEXTAREA); $facebook_tab = Ai1ec_Facebook_Factory::get_facebook_tab_instance(); $category_select = Ai1ec_View_Factory::create_select2_multiselect(array('name' => 'ai1ec_file_upload_feed_category[]', 'id' => 'ai1ec_file_upload_feed_category', 'use_id' => true, 'type' => 'category', 'placeholder' => __('Categories (optional)', AI1EC_PLUGIN_NAME)), get_terms('events_categories', array('hide_empty' => false))); $select2_tags = Ai1ec_View_Factory::create_select2_tags(array('id' => 'ai1ec_file_upload_feed_tags')); $message = false; if (isset($this->count)) { $text = __('No events were found', AI1EC_PLUGIN_NAME); if ($this->count > 0) { $text = sprintf(_n('Imported %s event', 'Imported %s events', $this->count, AI1EC_PLUGIN_NAME), $this->count); } $message = Ai1ec_Helper_Factory::create_bootstrap_message_instance($text); } $args = array("category_select" => $category_select, "tags" => $select2_tags, "submit" => $submit, "file_input" => $file_input, "textarea" => $textarea); if (false !== $message) { $args['message'] = $message; } $ai1ec_view_helper->display_admin('plugins/file_upload/file_upload.php', $args); $this->render_closing_div_of_tab(); }
/** * Renders the HTML for the Multiselect of the specified types * * @param array $types The type of Facebook Graph Object to render * * @param $current_id The id of the currently logged on user which must be excluded from subscribers and multiselects * * @return the HTML */ private function render_multiselects(array $types, $current_id) { $multiselects = $this->render_all_elements($types, TRUE, $current_id); $category_select = Ai1ec_View_Factory::create_select2_multiselect(array('id' => 'ai1ec_facebook_feed_category', 'name' => 'ai1ec_facebook_feed_category[]', 'use_id' => true, 'type' => 'category', 'placeholder' => __('Categories (optional)', AI1EC_PLUGIN_NAME), 'class' => 'categories'), get_terms('events_categories', array('hide_empty' => false))); $tags = Ai1ec_View_Factory::create_select2_tags(array('id' => 'ai1ec_facebook_feed_tags')); $label_category = esc_html__('Event category', AI1EC_PLUGIN_NAME); $label_tag = esc_html__('Tag with', AI1EC_PLUGIN_NAME); $label_refresh = esc_html__('Refresh list', AI1EC_PLUGIN_NAME); $html = '<h1>' . esc_html__('Subscribe to more events', AI1EC_PLUGIN_NAME) . '</h1>'; $html .= '<p>'; $html .= esc_html__("You can subscribe to the shared calendars of friends, pages, and groups you are connected with. Select those calendars you're interested in below.", AI1EC_PLUGIN_NAME); $html .= '</p>'; $html .= '<div class="row-fluid">'; foreach ($types as $type) { // Get the correct text for the type. $text = Ai1ec_Facebook_Graph_Object_Collection::get_type_printable_text($type); $html .= <<<HTML <div class="span4 ai1ec-facebook-multiselect-container" data-type="{$type}"> \t<div class="ai1ec-facebook-multiselect-title-wrapper"> \t\t<h2 class="ai1ec-facebook-header pull-left">{$text}</h2> \t\t<a class="ai1ec-facebook-refresh-multiselect btn btn-small"> \t\t\t<i class="icon-refresh"> \t\t\t</i> \t\t\t{$label_refresh} \t\t</a> \t\t<img src="images/wpspin_light.gif" class="ajax-loading pull-right" alt="" /> \t</div> \t<div class="clear"></div> \t{$multiselects[$type]} </div> HTML; } $html .= "</div>"; $submit_subscribe_value = __('Subscribe to selected', AI1EC_PLUGIN_NAME); $comments_label = __('Allow comments on imported events', AI1EC_PLUGIN_NAME); $map_display_label = __('Show map on imported events', AI1EC_PLUGIN_NAME); $category_html = $category_select->render_as_html(); $tags_html = $tags->render_as_html(); $html .= <<<HTML <div class="row-fluid ai1ec_submit_wrapper"> \t<div class="span6"> \t\t{$category_html} \t</div> \t<div class="span6"> \t\t{$tags_html} \t</div> </div> <div class="row-fluid ai1ec_facebook_comments_enabled_wrapper"> \t<label for="ai1ec_facebook_comments_enabled"> \t\t<input type="checkbox" name="ai1ec_facebook_comments_enabled" \t\t id="ai1ec_facebook_comments_enabled" value="1" /> \t\t{$comments_label} \t</label> </div> <div class="row-fluid ai1ec_facebook_map_display_enabled_wrapper"> \t<label for="ai1ec_facebook_map_display_enabled"> \t\t<input type="checkbox" name="ai1ec_facebook_map_display_enabled" \t\t id="ai1ec_facebook_map_display_enabled" value="1" /> \t\t{$map_display_label} \t</label> </div> <div class="row-fluid ai1ec_submit_wrapper"> \t<div class="span12"> \t\t<button type="submit" id="ai1ec_subscribe_users" class="btn btn-primary" \t\t\tname="ai1ec_subscribe_users"> \t\t\t<i class="icon-plus"></i> {$submit_subscribe_value} \t\t</button> \t</div> </div> HTML; return $html; }
/** * (non-PHPdoc) * @see Ai1ec_Connector_Plugin::render_tab_content() */ public function render_tab_content() { // Render the opening div $this->render_opening_div_of_tab(); // Render the body of the tab global $ai1ec_view_helper, $ai1ec_settings_helper, $ai1ec_settings; $select2_cats = Ai1ec_View_Factory::create_select2_multiselect(array('name' => 'ai1ec_feed_category[]', 'id' => 'ai1ec_feed_category', 'use_id' => true, 'type' => 'category', 'placeholder' => __('Categories (optional)', AI1EC_PLUGIN_NAME)), get_terms('events_categories', array('hide_empty' => false))); $select2_tags = Ai1ec_View_Factory::create_select2_tags(array('id' => 'ai1ec_feed_tags')); $modal = Ai1ec_Helper_Factory::create_bootstrap_modal_instance(esc_html__("Do you want to keep the events imported from the calendar or remove them?", AI1EC_PLUGIN_NAME)); $modal->set_header_text(esc_html__("Removing ICS Feed", AI1EC_PLUGIN_NAME)); $modal->set_keep_button_text(esc_html__("Keep Events", AI1EC_PLUGIN_NAME)); $modal->set_delete_button_text(esc_html__("Remove Events", AI1EC_PLUGIN_NAME)); $modal->set_id('ai1ec-ics-modal'); $args = array('cron_freq' => $ai1ec_settings_helper->get_cron_freq_dropdown($ai1ec_settings->cron_freq), 'event_categories' => $select2_cats, 'event_tags' => $select2_tags, 'feed_rows' => $ai1ec_settings_helper->get_feed_rows(), 'modal' => $modal); $ai1ec_view_helper->display_admin('plugins/ics/display_feeds.php', $args); $this->render_closing_div_of_tab(); }