/** * Get a map for a given event * @param object $event * @return string markup */ protected function get_map_markup($event) { $ret = ''; $lat = $event->has_value('latitude') ? $event->get_value('latitude') : false; $lon = $event->has_value('longitude') ? $event->get_value('longitude') : false; $address = $event->has_value('address') ? $event->get_value('address') : false; if (!empty($lat) && !empty($lon)) { $ret .= '<div class="eventMap">'; $static_map_base_url = 'https://maps.googleapis.com/maps/api/staticmap'; $params['size'] = '100x100'; $params['markers'] = 'color:0xFF6357|' . $lat . ',' . $lon; $params['sensor'] = 'false'; // lets add zoom level if it is set if ($zoom = $this->bundle->map_zoom_level($event)) { $params['zoom'] = $zoom; } $qs = carl_make_query_string($params); $static_map_url = $static_map_base_url . $qs; $google_maps_base_url = 'https://maps.google.com/maps/'; if ($address) { $google_maps_params['saddr'] = $event->get_value('address'); } else { $google_maps_params['q'] = $lat . ',' . $lon; } $google_maps_qs = carl_construct_query_string($google_maps_params); $google_maps_link = $google_maps_base_url . $google_maps_qs; $ret .= '<a href="' . $google_maps_link . '"><img src="' . $static_map_url . '" alt="map of ' . reason_htmlspecialchars($event->get_value('name')) . '" /></a>'; $ret .= '</div>'; } return $ret; }
<?php /** * Finds Reason entities that do not belong to a site. * * This has been replaced with an administrative module. We just redirect to that if this is hit. * * @deprecated * @package reason * @subpackage scripts */ include_once 'reason_header.php'; include_once CARL_UTIL_INC . 'basic/url_funcs.php'; $qs = carl_make_query_string(array('cur_module' => 'OrphanManager')); $redir = HTTPS_AVAILABLE ? 'https://' . REASON_WEB_ADMIN_PATH . $qs : 'http://' . REASON_WEB_ADMIN_PATH . $qs; header('Location: ' . $redir); exit; ?>
/** * Sends the uploader an email regarding the status of the media work's transcoding if they * wanted an email notification. * ** REASON_HOST must be set for the generated link to the media work to be correct. * * @param $media_work entity * @param $data object * @param $status string */ function send_email($media_work, $status, $netid) { if ($media_work->get_value('email_notification')) { $user = new entity(get_user_id($netid)); $dir = new directory_service(); $dir->search_by_attribute('ds_username', $netid, array('ds_email', 'ds_fullname', 'ds_phone')); $to = $dir->get_first_value('ds_email'); $owner = $media_work->get_owner(); $params = array('site_id' => $owner->id(), 'type_id' => id_of('av'), 'id' => $media_work->id(), 'cur_module' => 'Editor'); $query_string = carl_make_query_string($params); $link = html_entity_decode('https://' . REASON_HOST . '/reason/index.php' . $query_string); if ($status == 'success') { $subject = '[Reason] Media processing complete: ' . html_entity_decode(strip_tags($media_work->get_value('name'))); $message = 'Media Work Processed' . "\n\n"; $message .= 'Name:' . "\n" . html_entity_decode(strip_tags($media_work->get_value('name'))) . "\n\n"; $message .= 'Site:' . "\n" . html_entity_decode(strip_tags($owner->get_value('name'))) . "\n\n"; if (reason_username_has_access_to_site($netid, $owner->id())) { $message .= 'View it at this url: ' . $link . "\n\n"; } $message .= 'Uploaded by:' . "\n" . $user->get_value('name') . "\n\n"; } else { $subject = '[Reason] Media error: ' . html_entity_decode(strip_tags($media_work->get_value('name'))); $message = 'Media Work Error During Processing' . "\n\n"; $message .= 'Name:' . "\n" . html_entity_decode(strip_tags($media_work->get_value('name'))) . "\n\n"; $message .= 'Site:' . "\n" . html_entity_decode(strip_tags($owner->get_value('name'))) . "\n\n"; $message .= 'Uploaded by:' . "\n" . $user->get_value('name') . "\n\n"; if (reason_username_has_access_to_site($netid, $owner->id())) { $message .= 'View it at this url: ' . $link . "\n\n"; } $message .= 'If you continue to get this error after multiple attempts, please contact your Reason Administrator regarding this issue: ' . WEBMASTER_EMAIL_ADDRESS . "\n\n"; } mail($to, $subject, $message); } }