diff --git a/admin/admin.php b/admin/admin.php index 38d186d..58a5e2f 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -24,7 +24,23 @@ function get_page_url() { } function superdesk_admin() { + $post_formats = get_post_format_strings(); + if (isset($_POST['url'])) { + $resultArray = array(); + if (isset($_POST['post-formats-value'], $_POST['post-formats-input'])) { + foreach ($_POST['post-formats-value'] as $key => $value) { + if (!isset($_POST['post-formats-input'][$key])) { + continue; + } + if (isset($post_formats[$value])) { + $inputValue = $_POST['post-formats-input'][$key]; + if (!isset($resultArray[$inputValue]) && !empty($inputValue)) + $resultArray[$inputValue] = $value; + } + } + } + $settings = array( 'url' => $_POST['url'], 'username' => $_POST['username'], @@ -49,6 +65,8 @@ function superdesk_admin() { 'slugline-ignored' => $_POST['slugline-ignored'], 'priority_threshhold' => $_POST['priority_threshhold'], 'download-images' => $_POST['download-images'], + 'post-formats' => $_POST['download-images'], + 'post-formats-table' => $resultArray, ); update_option('superdesk_settings', $settings); } else if (get_option('superdesk_settings')) { @@ -78,6 +96,8 @@ function superdesk_admin() { 'slugline-ignored' => '', 'priority_threshhold' => '', 'download-images' => '', + 'post-formats' => '', + 'post-formats-table' => array(), ); } $statuses = array( @@ -102,400 +122,537 @@ function superdesk_admin() { foreach ($all_users as $user) { $authors[$user->ID] = $user->data->display_name; } + + function make_table_row($format, $text_value, $formats) { + $new_element = 'Delete'; + return $new_element; + } ?>
-

Superdesk Publisher

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Autoload/wp-content/plugins/superdesk-wordpress-plugin/autoload.php
- - - -
- - - -
- - - -
- - - -
- Status of the ingested articles/posts - -
- $value) { - ?> - -
- -
-
- - - -

- -
- - - -
- Choose words to replace from the byline - -
- -
- -
-
- Convert slugline keywords into WP tags - -
- -
- -
-
- Import SD keywords as WP tags - -
- -
- -
-
- Import Superdesk categories as Wordpress categories - -
- -
- -
-
- Import Superdesk subjects as - -
- -
- -
-
- - - -
- - - -
- Display the copyrightholder image - -
- -
- -
-
- Display the copyrightnotice image - -
- -
- -
-
- - - -
- Convert slugline keywords into WP tags - -
- -
- -
-
- - - -
- - - -
- - - -
- Download images from SD - -
- -
- -
-
-

- -

-
+

Superdesk Publisher

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Autoload/wp-content/plugins/superdesk-wordpress-plugin/autoload.php
+ + + +
+ + + +
+ + + +
+ + + +
+ Status of the ingested articles/posts + +
+ $value) { + ?> + +
+ +
+
+ + + +

+ +
+ + + +
+ Choose words to replace from the byline + +
+ +
+ +
+
+ Convert slugline keywords into WP tags + +
+ +
+ +
+
+ Import SD keywords as WP tags + +
+ +
+ +
+
+ Import Superdesk categories as Wordpress categories + +
+ +
+ +
+
+ Import Superdesk subjects as + +
+ +
+ +
+
+ + + +
+ + + +
+ Display the copyrightholder image + +
+ +
+ +
+
+ Display the copyrightnotice image + +
+ +
+ +
+
+ + + +
+ Convert slugline keywords into WP tags + +
+ +
+ +
+
+ + + +
+ + + +
+ + + +
+ Download images from SD + +
+ +
+ +
+
+ Match Superdesk Content Profiles with Wordpress Post Formats + +
+ +
+ +
+
+ + + + + + + + + + $value) { + echo make_table_row($value, $key, $post_formats); + } + } + ?> + +
Superdesk Content Profile NameWordpress Post FormatAdd row
+
+

+ +

+
+ + + Editors Note: " . wp_strip_all_tags($obj['ednote']) . "

"; + $content .= "

Editors Note: " . wp_strip_all_tags($obj['ednote']) . "

"; } if (isset($obj['evolvedfrom'])) { @@ -139,6 +139,12 @@ if ($obj['type'] == 'text') { 'post_category' => $category ); + if (isset($settings['post-formats'], $settings['post-formats-table']) and ! empty($obj['profile']) and $settings['post-formats'] == 'on') { + if (isset($settings['post-formats-table'][$obj['profile']])) { + set_post_format($post_ID, $settings['post-formats-table'][$obj['profile']]); + } + } + wp_update_post($edit_post); $attachmentExist = get_post_thumbnail_id($post_ID); @@ -177,6 +183,12 @@ if ($obj['type'] == 'text') { $post_ID = wp_insert_post($postarr, true); + if (isset($settings['post-formats'], $settings['post-formats-table']) and ! empty($obj['profile']) and $settings['post-formats'] == 'on') { + if (isset($settings['post-formats-table'][$obj['profile']])) { + set_post_format($post_ID, $settings['post-formats-table'][$obj['profile']]); + } + } + if ($taxonomyTag && !empty($taxonomyTag)) { wp_set_post_tags($post_ID, $taxonomyTag); }