function salsapress_salsa_setup() { if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } $options = get_option('salsapress_options'); if (isset($options['salsapress_salsa_activate']) && $options['salsapress_salsa_activate']) { $obj = SalsaConnect::singleton(); if ($obj->on() && empty($options['salsapress_salsa_org_base'])) { salsapress_reset_cache(); # Reset the cache $connect = $obj->post('gets', 'object=campaign_manager&include=chapter_KEY&include=organization_KEY&condition=Email=' . $options['salsapress_salsa_username']); $options['salsapress_salsa_chapter_base'] = $connect[0]->chapter_KEY; $options['salsapress_salsa_org_base'] = $connect[0]->organization_KEY; $crypt = new SalsaCrypt(SALSAPRESS_SALSA_PASS); $options['salsapress_salsa_pass'] = $crypt->pass; update_option('salsapress_options', $options); } } ?> <div class="wrap"> <div class="icon32" style="background: transparent url(<?php echo SALSAPRESS_BASE . 'images/salsa-big.png'; ?> ) no-repeat 0px 0px; height: 38px; " id="icon-options-general"><br></div> <h2><?php _e('Set Up Your Salsa Connection', 'salsapress'); ?> </h2> <?php _e('Connect WordPress to and and add synchronized reports, events, and sign-up forms.', 'salsapress'); ?> <form autocomplete='off' action="options.php" method="post"> <?php settings_fields('salsapress'); ?> <?php do_settings_sections(__FILE__); ?> <p class="submit"> <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'salsapress'); ?> " /> </p> </form> <h2><?php _e('Add-on Calendar Plugin', 'salsapress'); ?> </h2> <p><?php _e('Want your Salsa events in a calendar? We might be able to help. <a href="mailto:srduncombe@gmail.com">Contact Scott</a> about adding a salsa-powered-calendar.', 'salsapress'); ?> </p> <h3><a target="_blank" href="http://busproject.org/cal/"><?php _e('See it in action here', 'salsapress'); ?> </a></h3> <h2>About SalsaPress</h2> <p>Follow or contribute to the development of SalsaPress on <a href="https://github.com/BusProject/SalsaPress">Github</a>. It's mostly built and maintained by <a href="http://scottduncombe.com">Scott</a>.</p> <h3>The Bus Federation</h3> <p>Initial funding for the development of SalsaPress was provided by the <a href="http://busfederation.com/">Bus Federation</a>.</p> <h3>Kampaweb</h3> <p>Additional development has been funded by <a href="http://www.kampaweb.ch/">Kampaweb</a>.</p> <h2>Translations</h2> <p>SalsaPress now supports translations! Find the <code>.pot</code> file in the <code>lang</code> subfolder. Send <a href="mailto:srduncombe@gmail.com">me</a> your translated <code>.po</code> and <code>.mo</code> files - or submit a pull request on github - and I'll add them to the project.</p> </div> <?php }
function salsapress_reset_caches() { echo json_encode(array('success' => salsapress_reset_cache())); exit; }