getPlugin(); $settings = $arlima_plugin->loadSettings(); $export_manager = new Arlima_ExportManager($arlima_plugin); $import_manager = new Arlima_ImportManager($arlima_plugin); $list_factory = new Arlima_ListFactory(); $connector = new Arlima_ListConnector(); if( isset($_POST['settings']) ) { // Save some settings $settings = array_merge($settings, $_POST['settings']); if( !isset($_POST['settings']['streamer_colors']) ) $settings['streamer_colors'] = array(); $arlima_plugin->saveSettings($settings); // Save approved for export $approved = empty($_POST['approved']) ? array() : $_POST['approved']; $export_manager->setListsAvailableForExport($approved); // Remove imported lists if( !empty($_POST['remove_imported']) ) { foreach($_POST['remove_imported'] as $remove) { $import_manager->removeImportedList($remove); } } $message = __('Settings was successfully updated', '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 = $list_factory->loadListSlugs(); $has_exportable_list = false; foreach($lists as &$list_data) { if($export_manager->isAvailableForExport($list_data->id)) { $has_exportable_list = true; // Monkey patch the list object $list_data->approved = true; $list_data->export_page = false; $connector->setList($list_factory->loadList($list_data->id)); $pages = $connector->loadRelatedPages(); if(!empty($pages)) { // monkey patch from which page list can be exported $list_data->export_page = rtrim(get_permalink($pages[0]->ID),'/') .'/'.Arlima_Plugin::EXPORT_FEED_NAME.'/'; } array_unshift($lists_sorted, $list_data); } else { $list_data->approved = false; array_push($lists_sorted, $list_data); } } if( isset($message) ): ?>

()

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

()

getImportedLists() as $list_data) Arlima_ImportManager::displayImportedList($list_data['url'], $list_data['title']); ?>