1
|
|
|
<?php |
2
|
|
|
$ARCurrent->nolangcheck=true; |
3
|
|
|
$ARCurrent->allnls = true; |
4
|
|
|
if ($this->CheckLogin("edit") && $this->CheckConfig()) { |
5
|
|
|
$configcache=$ARConfig->cache[$this->path]; |
6
|
|
View Code Duplication |
if ($configcache->custom) { |
7
|
|
|
foreach( $configcache->custom as $key => $definition ) { |
8
|
|
|
if (($definition["type"]==$this->type) || |
9
|
|
|
($definition["inherit"] && ($this->implements($definition["type"])))) { |
10
|
|
|
$hascustomdata=true; |
11
|
|
|
break; |
12
|
|
|
} |
13
|
|
|
} |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
include($this->store->get_config("code")."widgets/wizard/code.php"); |
17
|
|
|
|
18
|
|
|
$wgWizFlow = array(); |
19
|
|
|
$wgWizFlow[] = array( |
20
|
|
|
"current" => $this->getdata("wgWizCurrent","none"), |
21
|
|
|
"cancel" => "dialog.edit.cancel.php", |
22
|
|
|
"save" => "dialog.edit.save.php" |
23
|
|
|
); |
24
|
|
|
$wgWizFlow[] = array( |
25
|
|
|
"title" => $ARnls["data"], |
26
|
|
|
"image" => $AR->dir->images.'wizard/data.png', |
27
|
|
|
"template" => "dialog.edit.form.php" |
28
|
|
|
); |
29
|
|
|
|
30
|
|
|
// Call edit flow which will add the remaining flow to the wizard if appropriate |
31
|
|
|
$wgWizFlow = $this->call("dialog.edit.flow.php", array( "wgWizFlow" => $wgWizFlow )); |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
// Custom data and locking gets added last. |
35
|
|
View Code Duplication |
if( $hascustomdata ) { |
36
|
|
|
$wgWizFlow[] = array( |
37
|
|
|
"title" => $ARnls["customdata"], |
38
|
|
|
"image" => $AR->dir->images.'wizard/customdata.png', |
39
|
|
|
"template" => "dialog.edit.custom.php" |
40
|
|
|
); |
41
|
|
|
} |
42
|
|
View Code Duplication |
if( !$this->lock('O')){ |
43
|
|
|
$i = $wgWizFlow[0]["current"]+1; |
44
|
|
|
$wgWizFlow[$i]["template"] = "dialog.edit.lock.php"; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
$arLanguage=$this->getdata("arLanguage","none"); |
48
|
|
|
if (!$arLanguage) { // language select hasn't been done yet, so start with default language |
49
|
|
|
$arLanguage=$ARConfig->nls->default; |
50
|
|
|
$ARCurrent->arLanguage=$arLanguage; |
51
|
|
|
} |
52
|
|
|
// call user overridable flow |
53
|
|
|
$ARCurrent->allnls = true; |
54
|
|
|
$wgWizFlow = $this->call("user.wizard.edit.html", array("wgWizFlow" => $wgWizFlow)); |
55
|
|
|
|
56
|
|
|
$this->call("typetree.ini"); |
57
|
|
|
$name=$ARCurrent->arTypeNames[$this->type]; |
58
|
|
|
|
59
|
|
|
// spawn wizard |
60
|
|
|
$wgWizHeaderIcon = $this->call("system.get.icon.php"); |
61
|
|
|
$wgWizTitle=$ARnls["edit"]." ".$name; |
62
|
|
|
$wgWizHeader=$wgWizTitle; |
63
|
|
|
$wgWizTabsTemplate="dialog.edit.languagetabs.php"; |
64
|
|
|
|
65
|
|
|
include($this->store->get_config("code")."widgets/wizard/yui.wizard.html"); |
66
|
|
|
} |
67
|
|
|
?> |
|
|
|
|
68
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.