CMS  Version 3.9
import_profile_dialog.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("data_sync");
3 Fakoli::usingFeature("auto_form");
4 
5 $class = checkIdentifier($_GET["class"]);
6 $import_profile_id = checkNumeric($_GET["import_profile_id"]);
7 
9 
11 {
13 }
14 else
15 {
16  $profile->class = $class;
17 }
18 
19 $form = new AutoForm($profile, "POST", "/action/data_sync/import_profile_dialog?class=$class");
20 $form->ajaxSubmit("function(result) { importProfileManager.profileEdited(result);}", "function() {document.id('{$form->id}_error').set('text','Failed to communicate with server'); }");
21 
22 $form->hide("class");
23 $form->required("profile");
24 
25 if ($method == "POST")
26 {
27  if ($form->save())
28  {
29  Fakoli::end($form->data->import_profile_id);
30  }
31  else
32  {
33  Fakoli::end($form->msg);
34  }
35 }
36 
37 $script .= $form->writeScript();
38 $form->drawForm();
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
Definition: core.inc:1149
$method
Pull out a simple reference to the request method.
Definition: core.inc:1573
$import_profile_id
if($method=="POST") $script