0 ) { // Export settings saved if($_POST['type'] == 'export') { $approved = empty($_POST['approved']) ? array() : $_POST['approved']; $export_manager->setListsAvailableForExport($approved); $message = __('Export settings saved successfully', 'arlima'); } // Remove imported list elseif($_POST['type'] == 'remove_import') { $import_manager->removeImportedList($_POST['remove']); $message = __('Imported list successfully removed', 'arlima'); } } // Create a list of our arlima lists sorted so that those lists // approved for export comes first. Also find out from which // page the approved lists can be exported $lists_sorted = array(); $lists = Arlima_ListFactory::loadListSlugs(); $has_exportable_list = false; foreach($lists as $list) { if($export_manager->isAvailableForExport($list->id)) { $has_exportable_list = true; $list->approved = true; $list->export_page = false; $pages = get_posts(array( 'post_type' => array( 'post', 'page' ), 'meta_query' => array( array( 'key' => 'arlima', 'value' => $list->slug, 'compare' => '=' ) ) )); if(!empty($pages)) { // monkey patch from which page list can be exported $list->export_page = rtrim(get_permalink($pages[0]->ID),'/') .'/'.Arlima_Plugin::EXPORT_FEED_NAME.'/'; } array_unshift($lists_sorted, $list); } else { $list->approved = false; array_push($lists_sorted, $list); } } Arlima_Plugin::warnAboutMissingTemplate(); if( isset($message) ): ?>

approved): ?> export_page): ?> : export_page ?> slug.'"'); endif; ?>

()

getImportedLists(); if(count($imported) > 0): ?>