This commit is contained in:
Filip Penkava
2017-04-13 14:36:51 +02:00
parent 7a42198e02
commit 6dbdce8fb8
2 changed files with 35 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ function superdesk_admin() {
'convert-slugline' => $_POST['convert-slugline'],
'slugline-separator' => $_POST['slugline-separator'],
'slugline-ignored' => $_POST['slugline-ignored'],
'priority_threshhold' => $_POST['priority_threshhold'],
);
update_option('superdesk_settings', $settings);
} else if (get_option('superdesk_settings')) {
@@ -74,6 +75,7 @@ function superdesk_admin() {
'convert-slugline' => '',
'slugline-separator' => '',
'slugline-ignored' => '',
'priority_threshhold' => '',
);
}
$statuses = array(
@@ -441,6 +443,27 @@ function superdesk_admin() {
<input type="text" name="slugline-ignored" id="slugline-ignored" class="regular-text" value="<?php echo($settings['slugline-ignored']); ?>">
</td>
</tr>
<tr>
<th scope="row">
<label for="priority_threshhold">Priority threshhold of </label>
</th>
<td>
<select name="priority_threshhold" id="priority_threshhold">
<option value="0"> </option>
<?php
for ($i = 1; $i <= 6; $i++) {
?>
<option value="<?php echo($i); ?>"<?php
if (isset($settings['priority_threshhold']) && $settings['priority_threshhold'] == $i) {
echo(' selected');
}
?>><?php echo($i); ?></option>
<?php
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<p class="submit">

View File

@@ -22,9 +22,9 @@ if ($obj['type'] == 'text') {
$content = '<p>' . wp_strip_all_tags($obj['located']) . $settings['separator-located'] . $content;
}
/*if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) {
/* if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) {
$content.= "<p>" . wp_strip_all_tags($obj['associations']['featuremedia']['copyrightnotice']) . "</p>";
}*/
} */
if (!empty($obj['ednote'])) {
$content.= "<p>Editors Note: " . wp_strip_all_tags($obj['ednote']) . "</p>";
@@ -154,6 +154,12 @@ if ($obj['type'] == 'text') {
'time' => current_time('mysql')
)
);
if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) {
stick_post($post_ID);
} else {
unstick_post($post_ID);
}
} else {
$postarr = array(
'post_title' => wp_strip_all_tags($obj['headline']),
@@ -180,6 +186,10 @@ if ($obj['type'] == 'text') {
'time' => current_time('mysql')
)
);
if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) {
stick_post($post_ID);
}
}
/* save featured media */