|
@@ -15,13 +15,14 @@ |
15 |
15 |
|
#import "SettingsVC.h" |
16 |
16 |
|
#import "GenericWebViewVC.h" |
17 |
17 |
|
#import "RFRateMe.h" |
|
18 |
+ |
#import "TutorialViewController.h" |
18 |
19 |
|
|
|
20 |
+ |
#import <EAIntroView/EAIntroView.h> |
19 |
21 |
|
|
20 |
|
- |
@interface MenuVC ()<CustomIOSAlertViewDelegate> { |
|
22 |
+ |
@interface MenuVC ()<CustomIOSAlertViewDelegate, EAIntroDelegate> { |
21 |
23 |
|
NSMutableArray *itemsArray; |
22 |
24 |
|
NSArray *imagesForItemsArray; |
23 |
25 |
|
NSInteger _presentedRow; |
24 |
|
- |
|
25 |
26 |
|
} |
26 |
27 |
|
|
27 |
28 |
|
@property (nonatomic, weak) IBOutlet UILabel *userMainLabel; |
|
@@ -66,9 +67,7 @@ |
66 |
67 |
|
@"credits", |
67 |
68 |
|
@"logout", |
68 |
69 |
|
nil]; |
69 |
|
- |
|
70 |
|
- |
|
71 |
|
- |
|
|
70 |
+ |
|
72 |
71 |
|
} |
73 |
72 |
|
|
74 |
73 |
|
|
|
@@ -186,8 +185,6 @@ |
186 |
185 |
|
[tableView deselectRowAtIndexPath:indexPath animated:NO]; |
187 |
186 |
|
} |
188 |
187 |
|
|
189 |
|
- |
|
190 |
|
- |
|
191 |
188 |
|
- (void) openMenuItem:(int) indexMenu { |
192 |
189 |
|
|
193 |
190 |
|
SWRevealViewController *revealController = self.revealViewController; |
|
@@ -215,15 +212,15 @@ |
215 |
212 |
|
} |
216 |
213 |
|
|
217 |
214 |
|
else if(indexMenu == 4) { |
218 |
|
- |
// newFrontController = [[WebViewVC alloc] init]; |
219 |
|
- |
// newFrontController.title = itemsArray[indexMenu]; |
220 |
|
- |
// |
221 |
|
- |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:FAQ_SAFARI([[NSUserDefaults standardUserDefaults] objectForKey:@"lang"])]; |
222 |
|
- |
// NSLog(@"WEB URL: %@", DATAMANAGER.menuWebViewURL); |
223 |
|
- |
newFrontController = [[WebViewVC alloc] init]; |
224 |
|
- |
newFrontController.title = itemsArray[indexMenu]; |
225 |
|
- |
DATAMANAGER.menuWebViewURL = [NSURL URLWithString:@"www.tre.it"]; |
226 |
|
- |
|
|
215 |
+ |
// newFrontController = [[WebViewVC alloc] init]; |
|
216 |
+ |
// newFrontController.title = itemsArray[indexMenu]; |
|
217 |
+ |
// |
|
218 |
+ |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:([[NSUserDefaults standardUserDefaults] objectForKey:@"lang"])]; |
|
219 |
+ |
// NSLog(@"WEB URL: %@", DATAMANAGER.menuWebViewURL); |
|
220 |
+ |
|
|
221 |
+ |
// newFrontController = [[WebViewVC alloc] init]; |
|
222 |
+ |
// newFrontController.title = itemsArray[indexMenu]; |
|
223 |
+ |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:@"www.tre.it"]; |
227 |
224 |
|
} |
228 |
225 |
|
|
229 |
226 |
|
else if(indexMenu == 5) { |
|
@@ -231,15 +228,8 @@ |
231 |
228 |
|
newFrontController = [[WebViewVC alloc] init]; |
232 |
229 |
|
newFrontController.title = itemsArray[indexMenu]; |
233 |
230 |
|
|
234 |
|
- |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:FAQ_SAFARI([[NSUserDefaults standardUserDefaults] objectForKey:@"lang"])]; |
235 |
231 |
|
DATAMANAGER.menuWebViewURL = [NSURL URLWithString:FAQ_SAFARI([DATAMANAGER defineLanguageWeb])]; |
236 |
232 |
|
NSLog(@"WEB URL: %@", DATAMANAGER.menuWebViewURL); |
237 |
|
- |
|
238 |
|
- |
|
239 |
|
- |
|
240 |
|
- |
// newFrontController = [[WebViewVC alloc] init]; |
241 |
|
- |
// newFrontController.title = itemsArray[indexMenu]; |
242 |
|
- |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:@"www.tre.it"]; |
243 |
233 |
|
} |
244 |
234 |
|
|
245 |
235 |
|
else if (indexMenu==6) { |
|
@@ -249,62 +239,51 @@ |
249 |
239 |
|
newFrontController = [[WebViewVC alloc] init]; |
250 |
240 |
|
newFrontController.title = itemsArray[indexMenu]; |
251 |
241 |
|
|
252 |
|
- |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:Partner_SAFARI([[NSUserDefaults standardUserDefaults] objectForKey:@"lang"])]; |
253 |
242 |
|
DATAMANAGER.menuWebViewURL = [NSURL URLWithString:Partner_SAFARI([DATAMANAGER defineLanguageWeb])]; |
254 |
|
- |
|
255 |
|
- |
|
256 |
243 |
|
NSLog(@"WEB URL: %@", DATAMANAGER.menuWebViewURL); |
257 |
|
- |
|
258 |
244 |
|
} |
259 |
245 |
|
else if (indexMenu==8) { |
260 |
246 |
|
newFrontController = [[WebViewVC alloc] init]; |
261 |
247 |
|
newFrontController.title = itemsArray[indexMenu]; |
262 |
248 |
|
|
263 |
|
- |
// DATAMANAGER.menuWebViewURL = [NSURL URLWithString:Credits_SAFARI([[NSUserDefaults standardUserDefaults] objectForKey:@"lang"])]; |
264 |
249 |
|
DATAMANAGER.menuWebViewURL = [NSURL URLWithString:Credits_SAFARI([DATAMANAGER defineLanguageWeb])]; |
265 |
|
- |
|
266 |
250 |
|
NSLog(@"WEB URL: %@", DATAMANAGER.menuWebViewURL); |
267 |
|
- |
|
268 |
251 |
|
} |
269 |
252 |
|
|
270 |
253 |
|
else if (indexMenu==9) { |
271 |
254 |
|
newFrontController = [[LoginVC alloc] init]; |
272 |
255 |
|
} |
273 |
256 |
|
|
274 |
|
- |
|
275 |
257 |
|
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:newFrontController]; |
276 |
258 |
|
[APPDEL setupNavigationBar:navigationController]; |
277 |
259 |
|
[revealController pushFrontViewController:navigationController animated:YES]; |
278 |
260 |
|
} |
279 |
261 |
|
|
|
262 |
+ |
#pragma mark - Tutorial |
280 |
263 |
|
|
281 |
264 |
|
-(NSString *)checkRouteStatus{ |
282 |
|
- |
|
|
265 |
+ |
|
283 |
266 |
|
NSArray *routeID=[DATAMANAGER.user.percorsi allKeys]; |
284 |
267 |
|
int started=0; |
285 |
268 |
|
int ended=0; |
286 |
269 |
|
|
287 |
270 |
|
for(int n=0 ;n < routeID.count;n++ ) { |
288 |
271 |
|
SFAPercorso *percorso=(SFAPercorso*)[DATAMANAGER.user.percorsi objectForKey:routeID[n]]; |
289 |
|
- |
|
|
272 |
+ |
|
290 |
273 |
|
if (percorso.routePois ==nil) { |
291 |
274 |
|
|
292 |
275 |
|
} |
293 |
276 |
|
|
294 |
|
- |
else if ([[DATAMANAGER poiForRoute:percorso] intValue] >0 && [[DATAMANAGER poiForRoute:percorso] intValue]<percorso.routePois.count && ([[DATAMANAGER.user.poiForRoute allKeys] containsObject:percorso.routeId])) |
295 |
|
- |
|
296 |
|
- |
{ |
|
277 |
+ |
else if ([[DATAMANAGER poiForRoute:percorso] intValue] >0 && [[DATAMANAGER poiForRoute:percorso] intValue]<percorso.routePois.count && ([[DATAMANAGER.user.poiForRoute allKeys] containsObject:percorso.routeId])) { |
297 |
278 |
|
started++; |
298 |
|
- |
|
299 |
279 |
|
} |
300 |
|
- |
|
301 |
|
- |
else if ( percorso.routePois.count==[[DATAMANAGER poiForRoute:percorso] intValue] || ([[DATAMANAGER.user.poiForRoute allKeys] containsObject:percorso.routeId])) |
302 |
|
- |
{ |
|
280 |
+ |
|
|
281 |
+ |
else if ( percorso.routePois.count==[[DATAMANAGER poiForRoute:percorso] intValue] || ([[DATAMANAGER.user.poiForRoute allKeys] containsObject:percorso.routeId])) { |
303 |
282 |
|
ended++; |
304 |
283 |
|
} |
305 |
284 |
|
} |
306 |
285 |
|
|
307 |
|
- |
return [NSString stringWithFormat:NSLocalizedString(@"StartedEndedLabel", nil),started,ended]; |
|
286 |
+ |
return [NSString stringWithFormat:NSLocalizedString(@"StartedEndedLabel", nil),started,ended]; |
308 |
287 |
|
} |
309 |
288 |
|
|
310 |
289 |
|
#pragma mark - MemoryWarning |
|
@@ -313,9 +292,9 @@ |
313 |
292 |
|
[super didReceiveMemoryWarning]; |
314 |
293 |
|
} |
315 |
294 |
|
|
|
295 |
+ |
#pragma mark - Custom actions |
316 |
296 |
|
|
317 |
|
- |
- (void)customIOS7dialogButtonTouchUpInside: (CustomIOSAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex |
318 |
|
- |
{ |
|
297 |
+ |
- (void)customIOS7dialogButtonTouchUpInside: (CustomIOSAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex { |
319 |
298 |
|
|
320 |
299 |
|
if(buttonIndex == 0) { |
321 |
300 |
|
|