4 $action->parent->AddJsRef(
"OFFLINE/Layout/admin.js");
5 $action->parent->AddCssRef(
"CORE:welcome.css",
true);
6 $action->parent->AddCssRef(
"OFFLINE:admin.css");
8 $command = getHttpVars(
'command',
'');
16 $action->lay->set(
'STATUS_CLASS',
'nop');
17 $action->lay->set(
'STATUS_MESSAGE',
'');
18 $action->lay->set(
'ERROR_LOG',
'');
24 include_once(
'OFFLINE/Class.OfflineClientBuilder.php');
26 $core_urlindex = $action->getParam(
'CORE_URLINDEX',
'');
27 if( $core_urlindex ==
'' ) {
28 $action->ExitError(sprintf(_(
"OFFLINE:Parameter %s must be set"),
'CORE_URLINDEX'));
32 $dest_dir = $action->parent->getParam(
'OFFLINE_CLIENT_BUILD_OUTPUT_DIR',
'');
33 if( ! is_dir($dest_dir) ) {
34 $action->ExitError(sprintf(_(
"OFFLINE:%s directory not found"), $dest_dir));
37 if( ! is_writable($dest_dir) ) {
38 $action->ExitError(sprintf(_(
"OFFLINE:%s directory not writable"), $dest_dir));
41 $dest_dir = realpath($dest_dir);
45 $customize_dir = $action->parent->getParam(
'OFFLINE_CLIENT_CUSTOMIZE_DIR',
'');
46 if( $customize_dir !=
'' ) {
47 if( ! is_dir($customize_dir) ) {
48 $action->ExitError(sprintf(_(
"OFFLINE:%s directory not found"), $customize_dir));
51 $customize_dir = realpath($customize_dir);
53 $opts[
'CUSTOMIZE_DIR'] = $customize_dir;
57 $ret = $ocb->buildAll();
58 if( $ret ===
false ) {
59 $action->lay->set(
'STATUS_CLASS',
'error');
60 $action->lay->set(
'STATUS_MESSAGE',
'Error');
61 $action->lay->set(
'ERROR_LOG', htmlspecialchars($ocb->error));
65 $action->lay->set(
'STATUS_CLASS',
'success');
66 $action->lay->set(
'STATUS_MESSAGE',
'OK');
67 $action->lay->set(
'ERROR_LOG',
'');