| @@ 151-155 (lines=5) @@ | ||
| 148 | // grab module name |
|
| 149 | $module_name = $module_method[0]; |
|
| 150 | // verify that a class method was registered properly |
|
| 151 | if ( ! isset( $module_method[1] )) { |
|
| 152 | $msg = sprintf( __( 'A class method for the %s route has not been properly registered.', 'event_espresso' ), $current_route ); |
|
| 153 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 154 | return FALSE; |
|
| 155 | } |
|
| 156 | // grab method |
|
| 157 | $method = $module_method[1]; |
|
| 158 | // verify that class exists |
|
| @@ 333-338 (lines=6) @@ | ||
| 330 | */ |
|
| 331 | public static function format ( $obj_with_address = null, $type = 'multiline', $use_schema = true, $add_wrapper = true ) { |
|
| 332 | // check that incoming object implements the EEI_Address interface |
|
| 333 | if ( ! $obj_with_address instanceof EEI_Address ) { |
|
| 334 | $msg = __( 'The address could not be formatted.', 'event_espresso' ); |
|
| 335 | $dev_msg = __( 'The EE_Address_Formatter requires passed objects to implement the EEI_Address interface.', 'event_espresso' ); |
|
| 336 | EE_Error::add_error( $msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 337 | return null; |
|
| 338 | } |
|
| 339 | // obtain an address formatter |
|
| 340 | $formatter = EEH_Address::_get_formatter( $type ); |
|
| 341 | // apply schema.org formatting ? |
|
| @@ 250-255 (lines=6) @@ | ||
| 247 | } else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) { |
|
| 248 | $event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event ); |
|
| 249 | self::$_event = $event->EE_Event; |
|
| 250 | } else { |
|
| 251 | $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' ); |
|
| 252 | $dev_msg = $user_msg . __( 'In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso' ); |
|
| 253 | EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 254 | return false; |
|
| 255 | } |
|
| 256 | return true; |
|
| 257 | } |
|
| 258 | ||
| @@ 1194-1198 (lines=5) @@ | ||
| 1191 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1192 | return FALSE; |
|
| 1193 | } |
|
| 1194 | if ( empty( $route )) { |
|
| 1195 | $msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route ); |
|
| 1196 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1197 | return FALSE; |
|
| 1198 | } |
|
| 1199 | if ( ! method_exists ( 'EED_' . $module, $method_name )) { |
|
| 1200 | $msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route ); |
|
| 1201 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| @@ 1199-1203 (lines=5) @@ | ||
| 1196 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1197 | return FALSE; |
|
| 1198 | } |
|
| 1199 | if ( ! method_exists ( 'EED_' . $module, $method_name )) { |
|
| 1200 | $msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route ); |
|
| 1201 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1202 | return FALSE; |
|
| 1203 | } |
|
| 1204 | EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name ); |
|
| 1205 | return TRUE; |
|
| 1206 | } |
|
| @@ 1258-1262 (lines=5) @@ | ||
| 1255 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1256 | return FALSE; |
|
| 1257 | } |
|
| 1258 | if ( empty( $forward )) { |
|
| 1259 | $msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route ); |
|
| 1260 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1261 | return FALSE; |
|
| 1262 | } |
|
| 1263 | if ( is_array( $forward )) { |
|
| 1264 | if ( ! isset( $forward[1] )) { |
|
| 1265 | $msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route ); |
|
| @@ 1264-1268 (lines=5) @@ | ||
| 1261 | return FALSE; |
|
| 1262 | } |
|
| 1263 | if ( is_array( $forward )) { |
|
| 1264 | if ( ! isset( $forward[1] )) { |
|
| 1265 | $msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route ); |
|
| 1266 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1267 | return FALSE; |
|
| 1268 | } |
|
| 1269 | if ( ! method_exists( $forward[0], $forward[1] )) { |
|
| 1270 | $msg = sprintf( __( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward[1], $route ); |
|
| 1271 | EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|