Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
   1: <?php
   2: 
   3: /**
   4:  *
   5:  * @package Plugin
   6:  * @subpackage FormAssistant
   7:  * @version SVN Revision $Rev:$
   8:  * @author marcus.gnass
   9:  * @copyright four for business AG
  10:  * @link http://www.4fb.de
  11:  */
  12: 
  13: // assert CONTENIDO framework
  14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
  15: 
  16: /**
  17:  * Page to be displayed in the left bottom frame.
  18:  * It provides a navigation for all forms defined for the current client and the
  19:  * current language.
  20:  *
  21:  * @author marcus.gnass
  22:  */
  23: class PifaLeftBottomPage extends cGuiPage {
  24: 
  25:     /**
  26:      * id of the PIFA content type
  27:      *
  28:      * @var int
  29:      */
  30:     protected $typeId;
  31: 
  32:     /**
  33:      * Create an instance.
  34:      */
  35:     public function __construct() {
  36: 
  37:         /**
  38:          *
  39:          * @param string $action to be performed
  40:          */
  41:         global $action;
  42: 
  43:         /**
  44:          *
  45:          * @param int $idform id of form to be edited
  46:          */
  47:         global $idform;
  48: 
  49:         parent::__construct('left_bottom', Pifa::getName());
  50: 
  51:         // get the id of the content type
  52:         $typeCollection = new cApiTypeCollection();
  53:         $typeCollection->select('type = "CMS_PIFAFORM"');
  54:         $type = $typeCollection->next();
  55:         $this->typeId = $type->get('idtype');
  56: 
  57:         $this->addScript('form_assistant.js');
  58:         $this->addScript('left_bottom.js');
  59: 
  60:         $this->set('s', 'dialog_title', Pifa::i18n('INUSE_DIALOG_TITLE'));
  61:         $this->set('s', 'menu', $this->_getMenu());
  62: 
  63:         // add translations to template
  64:         $this->set('s', 'I18N', json_encode(array(
  65:             'confirm_delete_form' => Pifa::i18n('CONFIRM_DELETE_FORM')
  66:         )));
  67:     }
  68: 
  69:     /**
  70:      * Get menu with all forms of current client in current language.
  71:      */
  72:     private function _getMenu() {
  73:         global $area;
  74: 
  75:         $cfg = cRegistry::getConfig();
  76:         $client = cRegistry::getClientId();
  77:         $lang = cRegistry::getLanguageId();
  78: 
  79:         // get all forms of current client in current language
  80:         $forms = PifaFormCollection::getByClientAndLang($client, $lang);
  81:         if (false === $forms) {
  82:             return '<!-- no forms for current client/language -->';
  83:         }
  84: 
  85:         // $formIcon = Pifa::getUrl() . 'images/icon_form.png';
  86: 
  87:         // collect usage information from the content table
  88:         $contentCollection = new cApiContentCollection();
  89:         // select all entries about the pifa content type
  90:         $formContent = $contentCollection->getFieldsByWhereClause(array(
  91:             'idartlang',
  92:             'value'
  93:         ), 'idtype = "' . $this->typeId . '"');
  94:         // get the idform and the related cApiArticleLanguage object and save them in an array
  95:         $assignedForms = array();
  96:         foreach ($formContent as $formRow) {
  97:             // read settings
  98:             $formRow['value'] = conHtmlEntityDecode($formRow['value']);
  99:             $formRow['value'] = utf8_encode($formRow['value']);
 100:             $settings = cXmlBase::xmlStringToArray($formRow['value']);
 101:             // if it was successful append the array of articles using this form
 102:             if ($settings['idform'] != '') {
 103:                 if (is_array($assignedForms[$settings['idform']])) {
 104:                     $assignedForms[$settings['idform']][] = new cApiArticleLanguage($formRow['idartlang']);
 105:                 } else {
 106:                     $assignedForms[$settings['idform']] = array(
 107:                         new cApiArticleLanguage($formRow['idartlang'])
 108:                     );
 109:                 }
 110:             }
 111:         }
 112: 
 113:         // create menu
 114:         $menu = new cGuiMenu();
 115:         while (false !== $form = $forms->next()) {
 116: 
 117:             $idform = $form->get('idform');
 118:             $formName = $form->get('name');
 119: 
 120:             $menu->setTitle($idform, $formName);
 121: 
 122:             // create link to show/edit the form
 123:             $link = new cHTMLLink();
 124:             $link->setMultiLink($area, '', $area, PifaRightBottomFormPage::SHOW_FORM);
 125:             $link->setCustom('idform', $idform);
 126:             $link->setAttribute('title', 'idform: ' . $idform);
 127:             $menu->setLink($idform, $link);
 128: 
 129:             // if this is true, then the form is in use
 130:             if (isset($assignedForms[$idform])) {
 131:                 // create a link for the action
 132:                 $link = new cHTMLLink();
 133:                 // set the class and the dialog text
 134:                 $link->setClass('in_use_link');
 135:                 $dialogText = Pifa::i18n("FOLLOWING_LIST_USES_FORM") . "<br><br>";
 136:                 foreach($assignedForms[$idform] as $article) {
 137:                     $dialogText .= '<b>' . $article->get('title') . '</b> - (' . $article->get('idart') . ')<br>';
 138:                 }
 139:                 $link->setAttribute("data-dialog-text", $dialogText);
 140:                 $link->setLink('javascript://');
 141: 
 142:                 $image = new cHTMLImage();
 143:                 $image->setSrc($cfg['path']['images'] . 'exclamation.gif');
 144:                 $link->setContent($image->render());
 145: 
 146:                 $menu->setActions($idform, 'inuse', $link);
 147:             }
 148: 
 149:             // create link to delete the form
 150:             if (cRegistry::getPerm()->have_perm_area_action('form', PifaRightBottomFormPage::DELETE_FORM)) {
 151:                 $link = new cHTMLLink();
 152:                 $link->setMultiLink($area, PifaRightBottomFormPage::DELETE_FORM, $area, PifaRightBottomFormPage::DELETE_FORM);
 153:                 $link->setCustom('idform', $idform);
 154:                 $link->setClass('pifa-icon-delete-form');
 155:                 $deleteForm = Pifa::i18n('DELETE_FORM');
 156:                 $link->setAlt($deleteForm);
 157:                 $link->setContent('<img src="' . $cfg['path']['images'] . 'delete.gif" title="' . $deleteForm . '" alt="' . $deleteForm . '">');
 158:                 // $menu->setLink($idform, $link);
 159:                 $menu->setActions($idform, 'delete', $link);
 160:             } else {
 161:                 $menu->setActions($idform, 'delete', '<img src="' . $cfg['path']['images'] . 'delete_inact.gif" title="' . $deleteForm . '" alt="' . $deleteForm . '">');
 162:             }
 163:         }
 164: 
 165:         return $menu->render(false);
 166:     }
 167: 
 168: }
 169: 
 170: /**
 171:  * Page for area "form" to be displayed in the right bottom frame.
 172:  *
 173:  * @author marcus.gnass
 174:  */
 175: class PifaRightBottomFormPage extends cGuiPage {
 176: 
 177:     /**
 178:      * Action constant.
 179:      *
 180:      * @var string
 181:      */
 182:     const SHOW_FORM = 'pifa_show_form';
 183: 
 184:     /**
 185:      * Action constant.
 186:      *
 187:      * @var string
 188:      */
 189:     const STORE_FORM = 'pifa_store_form';
 190: 
 191:     /**
 192:      * Action constant.
 193:      *
 194:      * @var string
 195:      */
 196:     const DELETE_FORM = 'pifa_delete_form';
 197: 
 198:     /**
 199:      * model for a single PIFA form
 200:      *
 201:      * @var PifaForm
 202:      */
 203:     private $_pifaForm = NULL;
 204: 
 205:     /**
 206:      * Creates and aggregates a model for a collection of PIFA forms
 207:      * and another for a single PIFA form.
 208:      *
 209:      * If an ID for an item is given this is loaded from database
 210:      * and its values are stored in the appropriate model.
 211:      *
 212:      * @throws PifaException if form could not be loaded
 213:      */
 214:     public function __construct() {
 215: 
 216:         /**
 217:          *
 218:          * @param string $action to be performed
 219:          */
 220:         global $action;
 221: 
 222:         /**
 223:          *
 224:          * @param int $idform id of form to be edited
 225:          */
 226:         global $idform;
 227: 
 228:         /**
 229:          *
 230:          * @param int $idfield id of field to be edited
 231:          */
 232:         global $idfield;
 233: 
 234:         parent::__construct('right_bottom', Pifa::getName());
 235: 
 236:         $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
 237:         $this->addStyle('right_bottom.css');
 238:         $this->addScript('form_assistant.js');
 239:         $this->addScript('right_bottom.js');
 240: 
 241:         // create models
 242:         $this->_pifaForm = new PifaForm();
 243: 
 244:         // load models
 245:         $idform = cSecurity::toInteger($idform);
 246:         if (0 < $idform) {
 247:             if (false === $this->_pifaForm->loadByPrimaryKey($idform)) {
 248:                 $msg = Pifa::i18n('FORM_LOAD_ERROR');
 249:                 throw new PifaException($msg);
 250:             }
 251:         }
 252: 
 253:         // add translations to template
 254:         $this->set('s', 'I18N', json_encode(array(
 255:             'cancel' => Pifa::i18n('CANCEL'),
 256:             'save' => Pifa::i18n('SAVE')
 257:         )));
 258: 
 259:         // dispatch action
 260:         try {
 261:             $this->_dispatch($action);
 262:         } catch (PifaException $e) {
 263:             $cGuiNotification = new cGuiNotification();
 264:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
 265:             $this->set('s', 'notification', $notification);
 266:             $this->set('s', 'content', '');
 267:         }
 268:     }
 269: 
 270:     /**
 271:      * Dispatches the given action.
 272:      *
 273:      * @param string $action to be executed
 274:      * @param string $notification
 275:      * @throws PifaException if the given action is unknown
 276:      * @throws PifaIllegalStateException if permissions are missing
 277:      */
 278:     protected function _dispatch($action, $notification = '') {
 279:         global $area;
 280: 
 281:         // check for permission
 282:         if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
 283:             $msg = Pifa::i18n('NO_PERMISSIONS');
 284:             throw new PifaIllegalStateException($msg);
 285:         }
 286: 
 287:         if (NULL === $action) {
 288:             $cGuiNotification = new cGuiNotification();
 289:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, Pifa::i18n('please select a form'));
 290:             $this->set('s', 'notification', $notification);
 291:             $this->set('s', 'content', '');
 292:             return;
 293:         }
 294: 
 295:         // dispatch actions
 296:         switch ($action) {
 297:             case self::SHOW_FORM:
 298:                 $this->set('s', 'notification', $notification);
 299:                 try {
 300:                     $this->set('s', 'content', $this->_showForm());
 301:                 } catch (SmartyCompilerException $e) {
 302:                     $this->set('s', 'content', Pifa::notifyException($e));
 303:                 }
 304:                 break;
 305: 
 306:             case self::STORE_FORM:
 307:                 $notification = '';
 308:                 try {
 309:                     $this->_storeForm();
 310:                     $this->setReload();
 311:                     // reload right_top after saving of form
 312:                     $idform = $this->_pifaForm->get('idform');
 313:                     $url = "main.php?area=form&frame=3&idform=$idform&action=" . PifaRightBottomFormPage::SHOW_FORM;
 314:                     $url = cRegistry::getSession()->url($url);
 315:                     $this->addScript("<script type=\"text/javascript\">
 316:                         Con.getFrame('right_top').location.href = '$url';
 317:                         </script>");
 318:                 } catch (Exception $e) {
 319:                     $notification = Pifa::notifyException($e);
 320:                 }
 321:                 $this->_dispatch(self::SHOW_FORM, $notification);
 322:                 break;
 323: 
 324:             case self::DELETE_FORM:
 325:                 $notification = '';
 326:                 try {
 327:                     $this->_deleteForm();
 328:                     $cGuiNotification = new cGuiNotification();
 329:                     $this->set('s', 'notification', $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, Pifa::i18n('FORM_DELETED')));
 330:                     $this->set('s', 'content', '');
 331:                     $this->setReload();
 332:                 } catch (Exception $e) {
 333:                     $notification = Pifa::notifyException($e);
 334:                 }
 335:                 break;
 336: 
 337:             default:
 338:                 $msg = Pifa::i18n('UNKNOWN_ACTION');
 339:                 throw new PifaException($msg);
 340:         }
 341:     }
 342: 
 343:     /**
 344:      * Build and return form for PIFA forms.
 345:      *
 346:      * @return string
 347:      */
 348:     private function _showForm() {
 349:         global $area;
 350: 
 351:         $cfg = cRegistry::getConfig();
 352: 
 353:         // get form action
 354:         $formAction = '';
 355:         if (cRegistry::getPerm()->have_perm_area_action('form', self::STORE_FORM)) {
 356:             $formAction = new cHTMLLink();
 357:             $formAction->setCLink($area, 4, self::STORE_FORM);
 358:             $formAction = $formAction->getHref();
 359:         }
 360: 
 361:         // get current or default values for form
 362:         if (!is_null($this->_pifaForm) && $this->_pifaForm->isLoaded()) {
 363:             $idform = $this->_pifaForm->get('idform');
 364:             $nameValue = $this->_pifaForm->get('name');
 365:             $dataTableValue = $this->_pifaForm->get('data_table');
 366:             $methodValue = $this->_pifaForm->get('method');
 367:             $withTimestampValue = (bool) $this->_pifaForm->get('with_timestamp');
 368:         } else {
 369:             $idform = NULL;
 370: 
 371:             // read item data from form
 372:             $nameValue = empty($_POST['name'])? '' : $_POST['name'];
 373:             $nameValue = cSecurity::unescapeDB($nameValue);
 374:             $nameValue = cSecurity::toString($nameValue);
 375:             $nameValue = trim($nameValue);
 376: 
 377:             $dataTableValue = empty($_POST['data_table'])? '' : $_POST['data_table'];
 378:             $dataTableValue = trim($dataTableValue);
 379:             $dataTableValue = strtolower($dataTableValue);
 380:             $dataTableValue = preg_replace('/[^a-z0-9_]/', '_', $dataTableValue);
 381: 
 382:             $methodValue = '';
 383:             $withTimestampValue = true;
 384:         }
 385: 
 386:         $tpl = cSmartyBackend::getInstance(true);
 387:         $tpl->assign('formAction', $formAction);
 388:         $tpl->assign('idform', $idform);
 389:         $tpl->assign('nameValue', $nameValue);
 390:         $tpl->assign('dataTableValue', $dataTableValue);
 391:         $tpl->assign('methodValue', strtoupper($methodValue));
 392:         $tpl->assign('withTimestampValue', $withTimestampValue);
 393:         $tpl->assign('hasWithTimestamp', Pifa::TIMESTAMP_BYFORM === Pifa::getTimestampSetting());
 394:         $tpl->assign('trans', array(
 395:             'legend' => Pifa::i18n('form'),
 396:             'name' => Pifa::i18n('form name'),
 397:             'dataTable' => Pifa::i18n('data table'),
 398:             'method' => Pifa::i18n('method'),
 399:             'withTimestamp' => Pifa::i18n('with timestamp'),
 400:             'pleaseChoose' => Pifa::i18n('please choose'),
 401:             'saveForm' => Pifa::i18n('save form')
 402:         ));
 403: 
 404:         $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_form']);
 405: 
 406:         return $out;
 407:     }
 408: 
 409:     /**
 410:      * Handles a POST request of the first form, showing a forms details.
 411:      *
 412:      * @throws PifaException
 413:      */
 414:     private function _storeForm() {
 415: 
 416:         // determine if item is loaded
 417:         $isLoaded = $this->_pifaForm->isLoaded();
 418: 
 419:         // read item data from form
 420:         $name = $_POST['name'];
 421:         $name = cSecurity::unescapeDB($name);
 422:         $name = cSecurity::toString($name);
 423:         $name = trim($name);
 424: 
 425:         $dataTable = $_POST['data_table'];
 426:         $dataTable = trim($dataTable);
 427:         $dataTable = strtolower($dataTable);
 428:         $dataTable = preg_replace('/[^a-z0-9_]/', '_', $dataTable);
 429: 
 430:         $method = $_POST['method'];
 431:         $method = trim($method);
 432:         $method = strtoupper($method);
 433: 
 434:         switch (Pifa::getTimestampSetting()) {
 435:             case Pifa::TIMESTAMP_NEVER:
 436:                 $withTimestamp = false;
 437:                 break;
 438:             case Pifa::TIMESTAMP_BYFORM:
 439:                 $withTimestamp = 'on' === $_POST['with_timestamp'];
 440:                 break;
 441:             case Pifa::TIMESTAMP_ALWAYS:
 442:                 $withTimestamp = true;
 443:                 break;
 444:         }
 445: 
 446:         // validate item data
 447:         if (0 === strlen($name)) {
 448:             $msg = Pifa::i18n('EMPTY_FORMNAME_ERROR');
 449:             throw new PifaException($msg);
 450:         }
 451:         if (0 === strlen($dataTable)) {
 452:             $msg = Pifa::i18n('EMPTY_DATETABLENAME_ERROR');
 453:             throw new PifaException($msg);
 454:         }
 455:         if (!in_array($method, array(
 456:             'GET',
 457:             'POST'
 458:         ))) {
 459:             $msg = Pifa::i18n('FORM_METHOD_ERROR');
 460:             throw new PifaException($msg);
 461:         }
 462: 
 463:         if ($isLoaded) {
 464:             // remember old table values
 465:             $oldDataTable = $this->_pifaForm->get('data_table');
 466:             $oldWithTimestamp = (bool) $this->_pifaForm->get('with_timestamp');
 467:         } else {
 468:             // create new item for given client & language
 469:             $pifaFormCollection = new PifaFormCollection();
 470:             $this->_pifaForm = $pifaFormCollection->createNewItem(array(
 471:                 'idclient' => cRegistry::getClientId(),
 472:                 'idlang' => cRegistry::getLanguageId()
 473:             ));
 474:         }
 475: 
 476:         // set item data
 477:         // Never, really never, call Item->set() if the value doesn't differ
 478:         // from the previous one. Otherwise the genericDb thinks that the item
 479:         // is modified and tries to store it resulting in a return value of
 480:         // false!
 481:         if ($name !== $this->_pifaForm->get('name')) {
 482:             $this->_pifaForm->set('name', $name);
 483:         }
 484:         if ($dataTable !== $this->_pifaForm->get('data_table')) {
 485:             $this->_pifaForm->set('data_table', $dataTable);
 486:         }
 487:         if (0 !== strcasecmp($method, $this->_pifaForm->get('method'))) {
 488:             $this->_pifaForm->set('method', $method);
 489:         }
 490:         if ($withTimestamp !== (bool) $this->_pifaForm->get('with_timestamp')) {
 491:             $this->_pifaForm->set('with_timestamp', $withTimestamp);
 492:         }
 493: 
 494:         if ($isLoaded) {
 495:             // optionally alter data table
 496:             // HINT: passing the old values is correct!
 497:             // The new values have already been stored inside the pifaForm
 498:             // object!
 499:             $this->_pifaForm->alterTable($oldDataTable, $oldWithTimestamp);
 500:         } else {
 501:             // create table
 502:             $this->_pifaForm->createTable($withTimestamp);
 503:         }
 504: 
 505:         // store item
 506:         if (false === $this->_pifaForm->store()) {
 507:             $msg = Pifa::i18n('FORM_STORE_ERROR');
 508:             $msg = sprintf($msg, $this->_pifaForm->getLastError());
 509:             throw new PifaException($msg);
 510:         }
 511:     }
 512: 
 513:     /**
 514:      */
 515:     private function _deleteForm() {
 516:         $this->_pifaForm->delete();
 517:         $this->_pifaForm = NULL;
 518:     }
 519: 
 520: }
 521: 
 522: /**
 523:  * Page for area "form_fields" to be displayed in the right bottom frame.
 524:  *
 525:  * @author marcus.gnass
 526:  */
 527: class PifaRightBottomFormFieldsPage extends cGuiPage {
 528: 
 529:     /**
 530:      * Action constant.
 531:      *
 532:      * @var string
 533:      */
 534:     const SHOW_FIELDS = 'pifa_show_fields';
 535: 
 536:     /**
 537:      * model for a single PIFA form
 538:      *
 539:      * @var PifaForm
 540:      */
 541:     private $_pifaForm = NULL;
 542: 
 543:     /**
 544:      * Creates and aggregates a model for a collection of PIFA forms
 545:      * and another for a single PIFA form.
 546:      *
 547:      * If an ID for an item is given this is loaded from database
 548:      * and its values are stored in the appropriate model.
 549:      *
 550:      * @throws PifaException if form could not be loaded
 551:      */
 552:     public function __construct() {
 553: 
 554:         /**
 555:          *
 556:          * @param string $action to be performed
 557:          */
 558:         global $action;
 559: 
 560:         /**
 561:          *
 562:          * @param int $idform id of form to be edited
 563:          */
 564:         global $idform;
 565: 
 566:         /**
 567:          *
 568:          * @param int $idfield id of field to be edited
 569:          */
 570:         global $idfield;
 571: 
 572:         parent::__construct('right_bottom', Pifa::getName());
 573: 
 574:         $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
 575:         $this->addStyle('right_bottom.css');
 576:         $this->addScript('form_assistant.js');
 577:         $this->addScript('right_bottom.js');
 578: 
 579:         // create models
 580:         $this->_pifaForm = new PifaForm();
 581: 
 582:         // load models
 583:         $idform = cSecurity::toInteger($idform);
 584:         if (0 < $idform) {
 585:             $ret = $this->_pifaForm->loadByPrimaryKey($idform);
 586:             if (false === $ret) {
 587:                 $msg = Pifa::i18n('FORM_LOAD_ERROR');
 588:                 throw new PifaException($msg);
 589:             }
 590:         }
 591: 
 592:         // add translations to template
 593:         $this->set('s', 'I18N', json_encode(array(
 594:             'cancel' => Pifa::i18n('CANCEL'),
 595:             'save' => Pifa::i18n('SAVE'),
 596:             'confirm_delete_field' => Pifa::i18n('CONFIRM_DELETE_FIELD')
 597:         )));
 598: 
 599:         // dispatch action
 600:         try {
 601:             $this->_dispatch($action);
 602:         } catch (PifaException $e) {
 603:             $cGuiNotification = new cGuiNotification();
 604:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
 605:             $this->set('s', 'notification', $notification);
 606:             $this->set('s', 'content', '');
 607:         }
 608:     }
 609: 
 610:     /**
 611:      * Dispatches the given action.
 612:      *
 613:      * @param string $action to be executed
 614:      * @param string $notification
 615:      * @throws PifaException if the given action is unknown
 616:      * @throws PifaIllegalStateException if permissions are missing
 617:      */
 618:     protected function _dispatch($action, $notification = '') {
 619:         global $area;
 620: 
 621:         // check for permission
 622:         if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
 623:             $msg = Pifa::i18n('NO_PERMISSIONS');
 624:             throw new PifaIllegalStateException($msg);
 625:         }
 626: 
 627:         if (NULL === $action) {
 628:             $this->set('s', 'notification', Pifa::i18n('please select a form'));
 629:             $this->set('s', 'content', '');
 630:             return;
 631:         }
 632: 
 633:         // dispatch actions
 634:         switch ($action) {
 635: 
 636:             case self::SHOW_FIELDS:
 637:                 $this->set('s', 'notification', $notification);
 638:                 try {
 639:                     $this->set('s', 'content', $this->_showFields());
 640:                 } catch (SmartyCompilerException $e) {
 641:                     $this->set('s', 'content', Pifa::notifyException($e));
 642:                 }
 643:                 break;
 644: 
 645:             default:
 646:                 $msg = Pifa::i18n('UNKNOWN_ACTION');
 647:                 throw new PifaException($msg);
 648:         }
 649:     }
 650: 
 651:     /**
 652:      */
 653:     private function _showFields() {
 654:         global $area;
 655: 
 656:         $cfg = cRegistry::getConfig();
 657: 
 658:         $idform = $idfield = NULL;
 659:         $fields = NULL;
 660:         $editField = $deleteField = NULL;
 661:         if ($this->_pifaForm->isLoaded()) {
 662: 
 663:             $idform = $this->_pifaForm->get('idform');
 664:             $idfield = $_GET['idfield'];
 665: 
 666:             $fields = $this->_pifaForm->getFields();
 667: 
 668:             if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::GET_FIELD_FORM)) {
 669:                 $editField = new cHTMLLink();
 670:                 $editField->setCLink('form_ajax', 4, PifaAjaxHandler::GET_FIELD_FORM);
 671:                 $editField->setCustom('idform', $idform);
 672:                 $editField = $editField->getHref();
 673:             }
 674: 
 675:             if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::DELETE_FIELD)) {
 676:                 $deleteField = new cHTMLLink();
 677:                 $deleteField->setCLink('form_ajax', 4, PifaAjaxHandler::DELETE_FIELD);
 678:                 $deleteField->setCustom('idform', $idform);
 679:                 $deleteField = $deleteField->getHref();
 680:             }
 681:         }
 682: 
 683:         // get and fill template
 684:         $tpl = cSmartyBackend::getInstance(true);
 685: 
 686:         $columnNames = array();
 687:         foreach ($this->_pifaForm->getFields() as $field) {
 688:             $columnNames[] = $field->get('column_name');
 689:         }
 690: 
 691:         // check for required email column at this form
 692:         if (!in_array('email', $columnNames)) {
 693:             $cGuiNotification = new cGuiNotification();
 694:             $email_notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_WARNING, Pifa::i18n('Currently there is no field called "email" in this form. Sending mails - if configured - to the user which entered the form data may not work!'));
 695:             $tpl->assign('email_notification', $email_notification);
 696:         }
 697: 
 698:         // translations
 699:         $tpl->assign('trans', array(
 700:             'legend' => Pifa::i18n('fields'),
 701:             'pleaseSaveFirst' => Pifa::i18n('please save first'),
 702:             'dialogTitle' => Pifa::i18n('edit field'),
 703:             'edit' => Pifa::i18n('EDIT'),
 704:             'delete' => Pifa::i18n('DELETE'),
 705:             'obligatory' => Pifa::i18n('OBLIGATORY')
 706:         ));
 707: 
 708:         // params
 709:         $tpl->assign('ajaxParams', implode('&', array(
 710:             'area=form_ajax',
 711:             'frame=4',
 712:             'contenido=' . cRegistry::getBackendSessionId()
 713:         )));
 714:         if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::GET_FIELD_FORM)) {
 715:             $tpl->assign('dragParams', implode('&', array(
 716:                 'area=form_ajax',
 717:                 'frame=4',
 718:                 'contenido=' . cRegistry::getBackendSessionId(),
 719:                 'action=' . PifaAjaxHandler::GET_FIELD_FORM,
 720:                 'idform=' . $idform
 721:             )));
 722:         }
 723:         if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::REORDER_FIELDS)) {
 724:             $tpl->assign('sortParams', implode('&', array(
 725:                 'area=form_ajax',
 726:                 'frame=4',
 727:                 'contenido=' . cRegistry::getBackendSessionId(),
 728:                 'action=' . PifaAjaxHandler::REORDER_FIELDS,
 729:                 'idform=' . $this->_pifaForm->get('idform')
 730:             )));
 731:         }
 732: 
 733:         // data
 734:         $tpl->assign('idform', $idform);
 735:         $tpl->assign('idfield', $idfield);
 736: 
 737:         $tpl->assign('fields', $fields);
 738:         $tpl->assign('fieldTypes', PifaField::getFieldTypeNames());
 739: 
 740:         // for partial
 741:         $tpl->assign('editField', $editField);
 742:         $tpl->assign('deleteField', $deleteField);
 743:         // define path to partial template for displaying a single field row
 744:         $tpl->assign('partialFieldRow', $cfg['templates']['pifa_ajax_field_row']);
 745: 
 746:         $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_fields']);
 747: 
 748:         return $out;
 749:     }
 750: 
 751: }
 752: 
 753: /**
 754:  * Page for area "form_data" to be displayed in the right bottom frame.
 755:  *
 756:  * @author marcus.gnass
 757:  */
 758: class PifaRightBottomFormDataPage extends cGuiPage {
 759: 
 760:     /**
 761:      * Action constant.
 762:      *
 763:      * @var string
 764:      */
 765:     const SHOW_DATA = 'pifa_show_data';
 766: 
 767:     /**
 768:      * model for a single PIFA form
 769:      *
 770:      * @var PifaForm
 771:      */
 772:     private $_pifaForm = NULL;
 773: 
 774:     /**
 775:      * Creates and aggregates a model for a collection of PIFA forms
 776:      * and another for a single PIFA form.
 777:      *
 778:      * If an ID for an item is given this is loaded from database
 779:      * and its values are stored in the appropriate model.
 780:      *
 781:      * @throws PifaException if form could not be loaded
 782:      */
 783:     public function __construct() {
 784: 
 785:         /**
 786:          *
 787:          * @param string $action to be performed
 788:          */
 789:         global $action;
 790: 
 791:         /**
 792:          *
 793:          * @param int $idform id of form to be edited
 794:          */
 795:         global $idform;
 796: 
 797:         /**
 798:          *
 799:          * @param int $idfield id of field to be edited
 800:          */
 801:         global $idfield;
 802: 
 803:         parent::__construct('right_bottom', Pifa::getName());
 804: 
 805:         $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
 806:         $this->addStyle('right_bottom.css');
 807:         $this->addScript('form_assistant.js');
 808:         $this->addScript('right_bottom.js');
 809: 
 810:         // create models
 811:         $this->_pifaForm = new PifaForm();
 812: 
 813:         // load models
 814:         $idform = cSecurity::toInteger($idform);
 815:         if (0 < $idform) {
 816:             if (false === $this->_pifaForm->loadByPrimaryKey($idform)) {
 817:                 $msg = Pifa::i18n('FORM_LOAD_ERROR');
 818:                 throw new PifaException($msg);
 819:             }
 820:         }
 821: 
 822:         // add translations to template
 823:         $this->set('s', 'I18N', json_encode(array(
 824:             'cancel' => Pifa::i18n('CANCEL'),
 825:             'save' => Pifa::i18n('SAVE')
 826:         )));
 827: 
 828:         // dispatch action
 829:         try {
 830:             $this->_dispatch($action);
 831:         } catch (PifaException $e) {
 832:             $cGuiNotification = new cGuiNotification();
 833:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
 834:             $this->set('s', 'notification', $notification);
 835:             $this->set('s', 'content', '');
 836:         }
 837:     }
 838: 
 839:     /**
 840:      * Dispatches the given action.
 841:      *
 842:      * @param string $action to be executed
 843:      * @param string $notification
 844:      * @throws PifaException if the given action is unknown
 845:      * @throws PifaIllegalStateException if permissions are missing
 846:      */
 847:     protected function _dispatch($action, $notification = '') {
 848:         global $area;
 849: 
 850:         // check for permission
 851:         if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
 852:             $msg = Pifa::i18n('NO_PERMISSIONS');
 853:             throw new PifaIllegalStateException($msg);
 854:         }
 855: 
 856:         if (NULL === $action) {
 857:             $this->set('s', 'notification', Pifa::i18n('please select a form'));
 858:             $this->set('s', 'content', '');
 859:             return;
 860:         }
 861: 
 862:         // dispatch actions
 863:         switch ($action) {
 864: 
 865:             case self::SHOW_DATA:
 866:                 $this->set('s', 'notification', $notification);
 867:                 try {
 868:                     $this->set('s', 'content', $this->_showData());
 869:                 } catch (SmartyCompilerException $e) {
 870:                     $this->set('s', 'content', Pifa::notifyException($e));
 871:                 }
 872:                 break;
 873: 
 874:             default:
 875:                 $msg = Pifa::i18n('UNKNOWN_ACTION');
 876:                 throw new PifaException($msg);
 877:         }
 878:     }
 879: 
 880:     /**
 881:      */
 882:     private function _showData() {
 883:         $cfg = cRegistry::getConfig();
 884: 
 885:         $tpl = cSmartyBackend::getInstance(true);
 886: 
 887:         // translations
 888:         $tpl->assign('trans', array(
 889:             'legend' => Pifa::i18n('data'),
 890:             'pleaseSaveFirst' => Pifa::i18n('please save first'),
 891:             'export' => Pifa::i18n('download data as CSV')
 892:         ));
 893: 
 894:         $tpl->assign('form', $this->_pifaForm);
 895:         $tpl->assign('getFileUrl', 'main.php?' . implode('&', array(
 896:             'area=form_ajax',
 897:             'frame=4',
 898:             'contenido=' . cRegistry::getBackendSessionId(),
 899:             'action=' . PifaAjaxHandler::GET_FILE
 900:         )));
 901: 
 902:         try {
 903:             $tpl->assign('fields', $this->_pifaForm->getFields());
 904:         } catch (Exception $e) {
 905:             $tpl->assign('fields', Pifa::notifyException($e));
 906:         }
 907: 
 908:         $tpl->assign('withTimestamp', (bool) $this->_pifaForm->get('with_timestamp'));
 909: 
 910:         try {
 911:             $data = $this->_pifaForm->getData();
 912:             $tpl->assign('data', $data);
 913:             if (!empty($data) && cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::EXPORT_DATA)) {
 914:                 $tpl->assign('exportUrl', 'main.php?' . implode('&', array(
 915:                     'area=form_ajax',
 916:                     'frame=4',
 917:                     'contenido=' . cRegistry::getBackendSessionId(),
 918:                     'action=' . PifaAjaxHandler::EXPORT_DATA,
 919:                     'idform=' . $this->_pifaForm->get('idform')
 920:                 )));
 921:             }
 922:         } catch (Exception $e) {
 923:             $tpl->assign('data', Pifa::notifyException($e));
 924:         }
 925: 
 926:         $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_data']);
 927: 
 928:         return $out;
 929:     }
 930: 
 931: }
 932: 
 933: /**
 934:  * Page for area "form_export" to be displayed in the right bottom frame.
 935:  * This page allows for exporting a form as XML.
 936:  *
 937:  * @author marcus.gnass
 938:  */
 939: class PifaRightBottomFormExportPage extends cGuiPage {
 940: 
 941:     /**
 942:      * Action constant.
 943:      *
 944:      * @var string
 945:      */
 946:     const EXPORT_FORM = 'pifa_export_form';
 947: 
 948:     /**
 949:      * model for a single PIFA form
 950:      *
 951:      * @var PifaForm
 952:      */
 953:     private $_pifaForm = NULL;
 954: 
 955:     /**
 956:      * Creates and aggregates a model for a single PIFA form.
 957:      *
 958:      * If an ID for an item is given this is loaded from database
 959:      * and its values are stored in the appropriate model.
 960:      *
 961:      * @throws PifaException if form could not be loaded
 962:      */
 963:     public function __construct() {
 964: 
 965:         /**
 966:          *
 967:          * @param string $action to be performed
 968:          */
 969:         global $action;
 970: 
 971:         /**
 972:          *
 973:          * @param int $idform id of form to be edited
 974:          */
 975:         global $idform;
 976: 
 977:         parent::__construct('right_bottom', Pifa::getName());
 978: 
 979:         $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
 980:         $this->addStyle('right_bottom.css');
 981:         $this->addScript('form_assistant.js');
 982:         $this->addScript('right_bottom.js');
 983:         
 984:         // add translations to template
 985:         $this->set('s', 'I18N', json_encode(array(
 986:             'cancel' => Pifa::i18n('CANCEL'),
 987:             'save' => Pifa::i18n('SAVE')
 988:         )));
 989: 
 990:         // create models
 991:         $this->_pifaForm = new PifaForm();
 992: 
 993:         // load models
 994:         $idform = cSecurity::toInteger($idform);
 995:         if (0 < $idform) {
 996:             if (false === $this->_pifaForm->loadByPrimaryKey($idform)) {
 997:                 $msg = Pifa::i18n('FORM_LOAD_ERROR');
 998:                 throw new PifaException($msg);
 999:             }
1000:         }
1001: 
1002:         // dispatch action
1003:         try {
1004:             $this->_dispatch($action);
1005:         } catch (PifaException $e) {
1006:             $cGuiNotification = new cGuiNotification();
1007:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
1008:             $this->set('s', 'notification', $notification);
1009:             $this->set('s', 'content', '');
1010:         }
1011:     }
1012: 
1013:     /**
1014:      * Dispatches the given action.
1015:      *
1016:      * @param string $action to be executed
1017:      * @param string $notification
1018:      * @throws PifaException if the given action is unknown
1019:      * @throws PifaIllegalStateException if permissions are missing
1020:      */
1021:     protected function _dispatch($action, $notification = '') {
1022: 
1023:         // dispatch actions
1024:         switch ($action) {
1025: 
1026:             case self::EXPORT_FORM:
1027: 
1028:                 // check for permission
1029:                 if (!cRegistry::getPerm()->have_perm_area_action('form_ajax', $action)) {
1030:                     $msg = Pifa::i18n('NO_PERMISSIONS');
1031:                     throw new PifaIllegalStateException($msg);
1032:                 }
1033: 
1034:                 $this->set('s', 'notification', $notification);
1035:                 try {
1036:                     $this->set('s', 'content', $this->_exportForm());
1037:                 } catch (SmartyCompilerException $e) {
1038:                     $this->set('s', 'content', Pifa::notifyException($e));
1039:                 }
1040:                 break;
1041: 
1042:             default:
1043:                 $msg = Pifa::i18n('UNKNOWN_ACTION');
1044:                 throw new PifaException($msg);
1045:         }
1046:     }
1047: 
1048:     /**
1049:      */
1050:     private function _exportForm() {
1051:         $cfg = cRegistry::getConfig();
1052: 
1053:         $tpl = cSmartyBackend::getInstance(true);
1054: 
1055:         // translations
1056:         $tpl->assign('trans', array(
1057:             'legend' => Pifa::i18n('pifa_export_form'),
1058:             'withData' => Pifa::i18n('WITH_DATA'),
1059:             'export' => Pifa::i18n('EXPORT')
1060:         ));
1061: 
1062:         $tpl->assign('formAction', 'main.php?' . implode('&', array(
1063:             'area=form_ajax',
1064:             'frame=4',
1065:             'contenido=' . cRegistry::getBackendSessionId(),
1066:             'action=' . PifaAjaxHandler::EXPORT_FORM,
1067:             'idform=' . $this->_pifaForm->get('idform')
1068:         )));
1069: 
1070:         $tpl->assign('idform', $this->_pifaForm->get('idform'));
1071: 
1072:         $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_export']);
1073: 
1074:         return $out;
1075:     }
1076: 
1077: }
1078: 
1079: /**
1080:  * Page for area "form_import" to be displayed in the right bottom frame.
1081:  * This page allows for importing a form that is available as XML.
1082:  *
1083:  * @author marcus.gnass
1084:  */
1085: class PifaRightBottomFormImportPage extends cGuiPage {
1086: 
1087:     /**
1088:      * Action constant.
1089:      *
1090:      * @var string
1091:      */
1092:     const IMPORT_FORM = 'pifa_import_form';
1093: 
1094:     /**
1095:      * Create an instance.
1096:      * Dispatches the current action and displays a notification.
1097:      */
1098:     public function __construct() {
1099: 
1100:         /**
1101:          *
1102:          * @param string $action to be performed
1103:          */
1104:         global $action;
1105: 
1106:         parent::__construct('right_bottom', Pifa::getName());
1107: 
1108:         $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
1109:         $this->addStyle('right_bottom.css');
1110:         $this->addScript('form_assistant.js');
1111:         $this->addScript('right_bottom.js');
1112: 
1113:         // add translations to template
1114:         $this->set('s', 'I18N', json_encode(array(
1115:             'cancel' => Pifa::i18n('CANCEL'),
1116:             'save' => Pifa::i18n('SAVE')
1117:         )));
1118: 
1119:         // dispatch action
1120:         try {
1121:             $this->_dispatch($action);
1122:         } catch (PifaException $e) {
1123:             $cGuiNotification = new cGuiNotification();
1124:             $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
1125:             $this->set('s', 'notification', $notification);
1126:             $this->set('s', 'content', '');
1127:         }
1128:     }
1129: 
1130:     /**
1131:      * Dispatches the given action.
1132:      *
1133:      * @param string $action to be executed
1134:      * @param string $notification
1135:      * @throws PifaException if the given action is unknown
1136:      * @throws PifaIllegalStateException if permissions are missing
1137:      */
1138:     protected function _dispatch($action, $notification = '') {
1139:         global $area;
1140: 
1141:         // check for permission
1142:         if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
1143:             $msg = Pifa::i18n('NO_PERMISSIONS');
1144:             throw new PifaIllegalStateException($msg);
1145:         }
1146: 
1147:         // dispatch actions
1148:         switch ($action) {
1149: 
1150:             case self::IMPORT_FORM:
1151:                 $this->set('s', 'notification', $notification);
1152:                 try {
1153: 
1154:                     switch (strtoupper($_SERVER['REQUEST_METHOD'])) {
1155:                         case 'GET':
1156:                             $this->set('s', 'content', $this->_importFormGet());
1157:                             break;
1158: 
1159:                         case 'POST':
1160:                             $this->set('s', 'content', $this->_importFormPost());
1161:                             break;
1162:                     }
1163: 
1164:                     $this->setReload();
1165:                 } catch (SmartyCompilerException $e) {
1166:                     $this->set('s', 'content', Pifa::notifyException($e));
1167:                 }
1168:                 break;
1169: 
1170:             default:
1171:                 $msg = Pifa::i18n('UNKNOWN_ACTION');
1172:                 throw new PifaException($msg);
1173:         }
1174:     }
1175: 
1176:     /**
1177:      * Handles the GET & POST request for the form_import area.
1178:      * On a GET request a form is displayed that allows for uploading an XML
1179:      * export file and an additional checkbox to select if gathered data should
1180:      * be imported too.
1181:      * On a POST request the import of the uploaded file is performed via
1182:      * PifaImporter. Eventually a notification is displayed.
1183:      *
1184:      * @return string
1185:      */
1186:     private function _importFormGet($showTableNameField = false) {
1187:         $cfg = cRegistry::getConfig();
1188: 
1189:         $tpl = cSmartyBackend::getInstance(true);
1190: 
1191:         // translations
1192:         $tpl->assign('trans', array(
1193:             'legend' => Pifa::i18n('pifa_import_form'),
1194:             'xml' => Pifa::i18n('XML'),
1195:             'used_table_name_error' => Pifa::i18n('USED_TABLE_NAME_ERROR'),
1196:             'table_name' => Pifa::i18n('data table'),
1197:             'export' => Pifa::i18n('IMPORT')
1198:         ));
1199: 
1200:         $tpl->assign('formAction', 'main.php?' . implode('&', array(
1201:             'area=form_import',
1202:             'frame=4',
1203:             'contenido=' . cRegistry::getBackendSessionId(),
1204:             'action=' . self::IMPORT_FORM
1205:         )));
1206: 
1207:         $tpl->assign('showTableNameField', $showTableNameField);
1208: 
1209:         $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_import']);
1210: 
1211:         return $out;
1212:     }
1213: 
1214:     /**
1215:      * Handles the GET & POST request for the form_import area.
1216:      * On a GET request a form is displayed that allows for uploading an XML
1217:      * export file and an additional checkbox to select if gathered data should
1218:      * be imported too.
1219:      * On a POST request the import of the uploaded file is performed via
1220:      * PifaImporter. Eventually a notification is displayed.
1221:      *
1222:      * @return string
1223:      */
1224:     private function _importFormPost() {
1225:         $cGuiNotification = new cGuiNotification();
1226: 
1227:         // read XML from file
1228:         $xml = file_get_contents($_FILES['xml']['tmp_name']);
1229:         $tableName = isset($_POST['table_name'])? $_POST['table_name'] : NULL;
1230: 
1231:         // check read operation
1232:         if (false === $xml) {
1233:             $note = Pifa::i18n('READ_XML_ERROR');
1234:             return $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $note);
1235:         }
1236: 
1237:         try {
1238: 
1239:             // perform import process
1240:             $pifaImporter = new PifaImporter();
1241:             $pifaImporter->setTableName($tableName);
1242:             $pifaImporter->import($xml);
1243: 
1244:             // display success message
1245:             $note = Pifa::i18n('IMPORT_SUCCESS');
1246:             $out = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, $note);
1247:         } catch (PifaDatabaseException $e) {
1248:             $out = $this->_importFormGet(true);
1249:         }
1250: 
1251:         return $out;
1252:     }
1253: 
1254: }
1255: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen