Permalink
Browse files

Fixes #95

Merge branch 'feature/use-options-general-95' into develop
  • Loading branch information...
jondavidjohn committed Aug 27, 2012
2 parents bad0598 + 5e4655a commit 1f7e7c668ed3f63034ec678d2756044fe8241b22
@@ -9,7 +9,7 @@
/**
* Formats previous broadcasts for display.
- *
+ *
* @param string $broadcasted_id
* @param array $broadcast
* @param object $account
@@ -37,7 +37,7 @@ private function previous_broadcast_excerpt($broadcasted_id, $broadcast, $accoun
}
/**
* Displays the broadcast options form.
- *
+ *
* @return void
*/
public function action_options() {
@@ -46,7 +46,7 @@ public function action_options() {
if ($post === null) {
wp_redirect(admin_url('index.php'));
}
-
+
return;
}
@@ -102,7 +102,7 @@ public function action_options() {
if (isset($errors[$key])) {
$errors[$key] = array();
}
-
+
$errors[$key][$page_id] = __('Please enter content to be broadcasted.', 'social');
}
else {
@@ -114,7 +114,7 @@ public function action_options() {
if (!isset($account_content_meta[$key])) {
$account_content_meta[$key] = array();
}
-
+
$account_content_meta[$key][$page_id] = $account_content[$key][$page_id];
$account_service_meta[$key][$page_id] = $service->get_broadcast_extras($page_id, $post);
}
@@ -163,7 +163,7 @@ public function action_options() {
if (!isset($broadcast_accounts[$key])) {
$broadcast_accounts[$key] = array();
}
-
+
if (!isset($broadcast_accounts[$key][$page_id])) {
if (isset($universal_pages[$page_id])) {
$broadcast_accounts[$key][$page_id] = (object) array(
@@ -202,7 +202,7 @@ public function action_options() {
if ($location == null) {
$location = get_edit_post_link($post->ID, false);
}
-
+
wp_redirect($location);
exit;
}
@@ -331,7 +331,7 @@ public function action_options() {
}
}
}
-
+
$default_accounts = $this->social->default_accounts($post);
$broadcast_accounts = array();
@@ -364,8 +364,8 @@ public function action_options() {
if (count($errors)) {
$content = stripslashes($_POST['social_account_content'][$key][$id]);
$checked = (
- isset($_POST['social_accounts']) &&
- isset($_POST['social_accounts'][$key]) &&
+ isset($_POST['social_accounts']) &&
+ isset($_POST['social_accounts'][$key]) &&
in_array($data['field_value_checked'], $_POST['social_accounts'][$key])
);
// TODO - Facebook pages check, abstract this
@@ -388,8 +388,8 @@ public function action_options() {
// TODO - abstract this
// check to see if a facebook page should be selected by default
// our data structure currently makes this awkward
- if (!$checked && $key == 'facebook' &&
- isset($default_accounts[$key]) &&
+ if (!$checked && $key == 'facebook' &&
+ isset($default_accounts[$key]) &&
isset($default_accounts[$key]['pages']) &&
is_array($default_accounts[$key]['pages'])) {
foreach ($default_accounts[$key]['pages'] as $page_parent_account) {
@@ -521,7 +521,7 @@ public function action_run($post_id = null) {
'username' => $account->name(),
'service' => $service->title(),
));
-
+
$response = $service->broadcast($account, $message, $args, $post->ID);
if ($response !== false) {
if ($response->limit_reached()) {
@@ -37,7 +37,7 @@ public function action_index() {
$accounts[$account[0]][] = $account[1];
}
}
-
+
$accounts = apply_filters('social_settings_default_accounts', $accounts, $this);
if (count($accounts)) {
@@ -61,7 +61,7 @@ public function action_index() {
wp_unschedule_event($timestamp, 'social_cron_15_init');
}
}
-
+
// Disable Social's comment display feature
if (isset($_POST['social_use_standard_comments'])) {
Social::option('use_standard_comments', '1');
@@ -83,7 +83,7 @@ public function action_index() {
wp_redirect(Social::settings_url(array('saved' => 'true')));
exit;
}
-
+
$accounts = array();
foreach ($this->social->services() as $key => $service) {
if (!isset($accounts[$key])) {
View
@@ -64,7 +64,7 @@ public function authorize_url() {
$params = '?social_controller=auth&social_action=authorize&target='.urlencode($url);
if (is_admin()) {
- $url = (defined('IS_PROFILE_PAGE') ? 'profile.php' : 'index.php');
+ $url = (defined('IS_PROFILE_PAGE') ? 'profile.php' : 'options-general.php');
$url = admin_url($url.$params);
}
else {
View
@@ -494,7 +494,7 @@ public function check_system_cron() {
wp_schedule_event(time() + 900, 'every15min', 'social_cron_15_init');
}
wp_remote_get(
- admin_url('index.php?'.http_build_query(array(
+ admin_url('options_general.php?'.http_build_query(array(
'social_controller' => 'cron',
'social_action' => 'check_crons',
'social_api_key' => Social::option('system_cron_api_key')
@@ -576,7 +576,7 @@ public function admin_notices() {
$suppress_no_accounts_notice = get_user_meta(get_current_user_id(), 'social_suppress_no_accounts_notice', true);
if (!$this->_enabled and (!isset($_GET['page']) or $_GET['page'] != basename(SOCIAL_FILE)) and empty($suppress_no_accounts_notice)) {
- $dismiss = sprintf(__('<a href="%s" class="social_dismiss">[Dismiss]</a>', 'social'), esc_url(admin_url('index.php?social_controller=settings&social_action=suppress_no_accounts_notice')));
+ $dismiss = sprintf(__('<a href="%s" class="social_dismiss">[Dismiss]</a>', 'social'), esc_url(admin_url('options-general.php?social_controller=settings&social_action=suppress_no_accounts_notice')));
$message = sprintf(__('To start using Social, please <a href="%s">add an account</a>.', 'social'), esc_url(Social::settings_url()));
echo '<div class="error"><p>'.$message.' '.$dismiss.'</p></div>';
}
@@ -604,7 +604,7 @@ public function admin_notices() {
$suppress_enable_notice = get_user_meta(get_current_user_id(), 'social_suppress_enable_notice', true);
if (empty($suppress_enable_notice)) {
$message = __('When you enable Social, users will be created when they log in with Facebook or Twitter to comment. These users are created without a role and will be prevented from accessing the admin side of WordPress until an administrator edits the user to give them a role.', 'social');
- $dismiss = sprintf(__('<a href="%s" class="social_dismiss">[Dismiss]</a>', 'social'), esc_url(admin_url('index.php?social_controller=settings&social_action=suppress_enable_notice')));
+ $dismiss = sprintf(__('<a href="%s" class="social_dismiss">[Dismiss]</a>', 'social'), esc_url(admin_url('options-general.php?social_controller=settings&social_action=suppress_enable_notice')));
echo '<div class="updated"><p>'.$message.' '.$dismiss.'</p></div>';
}
}
@@ -613,7 +613,7 @@ public function admin_notices() {
$error = Social::option('log_write_error');
if ($error == '1') {
echo '<div class="error"><p>'.
- sprintf(__('%s needs to be writable for Social\'s logging. <a href="%" class="social_dismiss">[Dismiss]</a>', 'social'), esc_html(Social::$plugins_path), esc_url(admin_url('index.php?social_controller=settings&social_action=clear_log_write_error'))).
+ sprintf(__('%s needs to be writable for Social\'s logging. <a href="%" class="social_dismiss">[Dismiss]</a>', 'social'), esc_html(Social::$plugins_path), esc_url(admin_url('options-general.php?social_controller=settings&social_action=clear_log_write_error'))).
'</p></div>';
}
}
@@ -623,7 +623,7 @@ public function admin_notices() {
if (!empty($deauthed)) {
foreach ($deauthed as $service => $data) {
foreach ($data as $id => $message) {
- $dismiss = sprintf(__('<a href="%s" class="%s">[Dismiss]</a>', 'social'), esc_url(admin_url('index.php?social_controller=settings&social_action=clear_deauth&id='.$id.'&service='.$service)), 'social_dismiss');
+ $dismiss = sprintf(__('<a href="%s" class="%s">[Dismiss]</a>', 'social'), esc_url(admin_url('options-general.php?social_controller=settings&social_action=clear_deauth&id='.$id.'&service='.$service)), 'social_dismiss');
echo '<div class="error"><p>'.esc_html($message).' '.$dismiss.'</p></div>';
}
}
@@ -657,7 +657,7 @@ public function admin_notices() {
$output = sprintf($output, esc_url(admin_url('profile.php#social-networks')));
}
- $dismiss = sprintf(__('<a href="%s" class="%s">[Dismiss]</a>', 'social'), esc_url(admin_url('index.php?social_controller=settings&social_action=clear_2_0_upgrade')), 'social_dismiss');
+ $dismiss = sprintf(__('<a href="%s" class="%s">[Dismiss]</a>', 'social'), esc_url(admin_url('options-general.php?social_controller=settings&social_action=clear_2_0_upgrade')), 'social_dismiss');
echo '<div class="error"><p>'.$output.' '.$dismiss.'</p></div>';
}
}
@@ -1658,7 +1658,7 @@ public function comment($comment, array $args = array(), $depth = 0) {
*/
public function post_row_actions(array $actions, $post) {
if ($post->post_status == 'publish' && in_array(Social::option('fetch_comments'), array('1', '2'))) {
- $actions['social_aggregation'] = sprintf(__('<a href="%s" rel="%s">Social Comments</a>', 'social'), esc_url(wp_nonce_url(admin_url('index.php?social_controller=aggregation&social_action=run&post_id='.$post->ID), 'run')), $post->ID).
+ $actions['social_aggregation'] = sprintf(__('<a href="%s" rel="%s">Social Comments</a>', 'social'), esc_url(wp_nonce_url(admin_url('options-general.php?social_controller=aggregation&social_action=run&post_id='.$post->ID), 'run')), $post->ID).
'<img src="'.esc_url(admin_url('images/wpspin_light.gif')).'" class="social_run_aggregation_loader" />';
}
return $actions;
@@ -1693,13 +1693,13 @@ public function admin_bar_menu() {
<span class="social-dot">.</span>
<span class="social-dot">.</span>
)</span>',
- 'href' => esc_url(wp_nonce_url(admin_url('index.php?social_controller=aggregation&social_action=run&post_id='.$current_object->ID), 'run')),
+ 'href' => esc_url(wp_nonce_url(admin_url('options-general.php?social_controller=aggregation&social_action=run&post_id='.$current_object->ID), 'run')),
));
$wp_admin_bar->add_menu(array(
'parent' => 'comments',
'id' => 'social-add-tweet-by-url',
'title' => __('Add Tweet by URL', 'social')
- .'<form class="social-add-tweet" style="display: none;" method="get" action="'.esc_url(wp_nonce_url(admin_url('index.php?social_controller=import&social_action=from_url&social_service=twitter&post_id='.$current_object->ID), 'from_url')).'">
+ .'<form class="social-add-tweet" style="display: none;" method="get" action="'.esc_url(wp_nonce_url(admin_url('options-general.php?social_controller=import&social_action=from_url&social_service=twitter&post_id='.$current_object->ID), 'from_url')).'">
<input type="text" size="20" name="url" value="" autocomplete="off" />
<input type="submit" name="social-add-tweet-button" name="social-add-tweet-button" value="'.__('Add Tweet by URL', 'social').'" />
</form>',
@@ -1,4 +1,4 @@
-<form id="setup" method="post" action="<?php echo esc_url(admin_url('index.php?social_controller=settings&social_action=index')); ?>">
+<form id="setup" method="post" action="<?php echo esc_url(admin_url('options-general.php?social_controller=settings&social_action=index')); ?>">
<?php wp_nonce_field(); ?>
<input type="hidden" name="social_action" value="settings" />
<?php if (isset($_GET['saved'])): ?>
@@ -5,7 +5,7 @@
<p>
<input type="text" id="social-source-url" name="source_url" style="width:350px" />
<span class="submit" style="float:none">
- <a href="<?php echo esc_url(wp_nonce_url(admin_url('index.php?social_controller=import&social_action=from_url&social_service=twitter&post_id='.$post->ID), 'from_url')); ?>" id="import_from_url" class="button"><?php _e('Import Tweet', 'social'); ?></a>
+ <a href="<?php echo esc_url(wp_nonce_url(admin_url('options-general.php?social_controller=import&social_action=from_url&social_service=twitter&post_id='.$post->ID), 'from_url')); ?>" id="import_from_url" class="button"><?php _e('Import Tweet', 'social'); ?></a>
</span>
<img src="<?php echo esc_url(admin_url('images/wpspin_light.gif')); ?>" style="position:relative;top:4px;left:0;display:none" id="import_from_url_loader" />
<span id="social-import-error"></span>
@@ -20,7 +20,7 @@
</h4>
<p class="submit" style="clear:both;float:none;padding:0;">
- <a href="<?php echo esc_url(wp_nonce_url(admin_url('index.php?social_controller=aggregation&social_action=run&post_id='.$post->ID), 'run')); ?>" id="run_aggregation" class="button" style="float:left;margin-bottom:10px;"><?php _e('Find Social Comments', 'social'); ?></a>
+ <a href="<?php echo esc_url(wp_nonce_url(admin_url('options-general.php?social_controller=aggregation&social_action=run&post_id='.$post->ID), 'run')); ?>" id="run_aggregation" class="button" style="float:left;margin-bottom:10px;"><?php _e('Find Social Comments', 'social'); ?></a>
<img src="<?php echo esc_url(admin_url('images/wpspin_light.gif')); ?>" style="float:left;position:relative;top:4px;left:5px;display:none;" id="run_aggregation_loader" />
</p>
</div><!-- .social-meta-box-block -->

0 comments on commit 1f7e7c6

Please sign in to comment.