/**
  * Outputs the view.
  *
  * @ $request->setView  ( '' ) -define the view name
  */
 function output()
 {
     global $application;
     if (!isset($this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID)) {
         $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID = $this->HTML_TAGS_PREFIX;
     }
     //          -                             PersonInfoType,                   ,
     //                                    .
     $person_info_types = modApiFunc("Checkout", "getPersonInfoTypeList");
     foreach ($person_info_types as $id => $info) {
         if ($info['tag'] == $this->CHECKOUT_PREREQUISITE_NAME && $info['active'] == DB_FALSE) {
             return "";
         }
     }
     //Read the decrypted credit card data from the session
     $prerequisiteValidationResults = modApiFunc("Checkout", "getPrerequisiteValidationResults", $this->CHECKOUT_PREREQUISITE_NAME);
     if ($prerequisiteValidationResults["isMet"] == false) {
         return "";
     }
     // build direct tag list with values.
     // they are may be used in the container template.
     // Example: Local_Firstname();
     $this->direct_tags = modApiFunc("Checkout", "getPersonInfoTagList", $this->CHECKOUT_PREREQUISITE_NAME);
     /*        if ($this->NoView)
             {
                 $application->outputTagErrors(true, "CartContent", "Errors");
                 return "";
             }
             else
             {
                 $application->outputTagErrors(true, "CartContent", "Warnings");
             }*/
     $AttributesArray = array($this->HTML_TAGS_PREFIX . 'OutputAllAttributes' => "", $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID . 'OutputAllAttributes' => "", $this->HTML_TAGS_PREFIX . 'OutputAllAttributesRows' => "", $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID . 'OutputAllAttributesRows' => "");
     foreach ($prerequisiteValidationResults['validatedData'] as $data_id => $data) {
         if ($data['view_tag'] == "Statemenu") {
             $AttributesArray[$this->HTML_TAGS_PREFIX . "State"] = '';
         } else {
             if ($data['view_tag'] == "Statetext") {
             } else {
                 $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag']] = '';
             }
         }
     }
     $application->registerAttributes($AttributesArray);
     $application->registerAttributes($this->direct_tags);
     loadCoreFile('UUIDUtils.php');
     $this->templateFiller =& $application->getInstance('TemplateFiller');
     $this->template = $application->getBlockTemplate(UUIDUtils::cut_uuid_suffix($this->BLOCK_TAG_NAME, "js"));
     //__CLASS__ is lowercase class name, get_class() also returns class name in lowercase.
     $this->templateFiller->setTemplate($this->template);
     $retval = $this->templateFiller->fill("OutputContainer");
     return $retval;
 }
示例#2
0
 static function cut_uuid_suffix($text, $style)
 {
     //                . CCInfo             .
     // :                  getValidatedDataStructure            PersonInfoVariantID,         .
     $uuid_pattern = UUIDUtils::getRegexpPattern($style);
     $matches = array();
     if (preg_match($uuid_pattern, $text, $matches)) {
         $text = _ml_substr($text, 0, _ml_strlen($text) - UUIDUtils::getLength($style));
     } else {
     }
     return $text;
 }
 function asc_ctor($parameter)
 {
     loadCoreFile('UUIDUtils.php');
     $payment_module_id = $parameter;
     //                    javaScript            .
     $parameter = UUIDUtils::convert("minuses_and_capitals", "js", $parameter);
     //    checkout prerequisite' ,                           Person Info (e.g. CustomerInfo)
     $this->CHECKOUT_PREREQUISITE_NAME = Checkout::getAdditionalPrerequisiteName("bankAccountInfo", $payment_module_id);
     //         store      ,                          checkout prerequisite' .
     $this->CHECKOUT_STORE_BLOCK_NAME = "bank-account-info-input" . $parameter;
     //        html      ,                                   Person Info.
     $this->HTML_TAGS_PREFIX = "BankAccountInfo" . $parameter;
     //        html      ,                                   Person Info.
     //     .                  Container         .
     $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID = "BankAccountInfo";
     //                 .                          . (e.g. CheckoutCustomerInfoInput)
     $this->BLOCK_TAG_NAME = "CheckoutBankAccountInfoInput" . $parameter;
     //                                                      ,
     //                                                       :
     $this->{get_parent_class(__CLASS__)}();
 }
 function getAdditionalPrerequisiteName($prerequisite_type, $payment_module_id)
 {
     loadCoreFile('UUIDUtils.php');
     return $prerequisite_type . UUIDUtils::convert("minuses_and_capitals", "js", $payment_module_id);
 }
 /**
  * Outputs the view.
  *
  * @ $request->setView  ( '' ) -define the view name
  */
 function output()
 {
     global $application;
     if (!isset($this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID)) {
         $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID = $this->HTML_TAGS_PREFIX;
     }
     //          -                             PersonInfoType,                   ,
     //                                    .
     $person_info_types = modApiFunc("Checkout", "getPersonInfoTypeList");
     foreach ($person_info_types as $id => $info) {
         if ($info['tag'] == $this->CHECKOUT_PREREQUISITE_NAME && $info['active'] == DB_FALSE) {
             return "";
         }
     }
     /*        if ($this->NoView)
             {
                 $application->outputTagErrors(true, "CartContent", "Errors");
                 return "";
             }
             else
             {
                 $application->outputTagErrors(true, "CartContent", "Warnings");
             }*/
     //block items
     $AttributesArray = array('CreditCardInfoJSAttrRules' => '', 'SubmitedCheckoutStoreBlocksListItemName' => "", $this->HTML_TAGS_PREFIX . 'InputFormFieldSize' => "", $this->HTML_TAGS_PREFIX . 'InputFormFieldMaxlength' => "", $this->HTML_TAGS_PREFIX . 'InputAllAttributesRows' => "", $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID . 'InputAllAttributesRows' => "", $this->HTML_TAGS_PREFIX . 'JavascriptFunctions' => "", $this->HTML_TAGS_PREFIX_WITHOUT_MODULE_UID . 'JavascriptFunctions' => "");
     $prerequisiteValidationResults = modApiFunc("Checkout", "getPrerequisiteValidationResults", $this->CHECKOUT_PREREQUISITE_NAME);
     //Custom templates. As for now (2006 mar) they are not used.
     foreach ($prerequisiteValidationResults['validatedData'] as $data) {
         //            $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag']  . "LabelCssClass"] = '';
         $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag'] . "FieldLabel"] = '';
         $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag']] = '';
         //            $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag']  . "ErrorFlagClass"] = '';
         $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag'] . "InputFormFieldSize"] = '';
         $AttributesArray[$this->HTML_TAGS_PREFIX . $data['view_tag'] . "InputFormFieldMaxlength"] = '';
     }
     $application->registerAttributes($AttributesArray);
     $this->templateFiller =& $application->getInstance('TemplateFiller');
     loadCoreFile('UUIDUtils.php');
     $this->template = $application->getBlockTemplate(UUIDUtils::cut_uuid_suffix($this->BLOCK_TAG_NAME, "js"));
     //__CLASS__ is lowercase class name, get_class() also returns class name in lowercase.
     $this->templateFiller->setTemplate($this->template);
     //"Section" config.ini mechanism allowed to use two different templates with the same
     //  container name simultaneously. E.g. "Custom PersonInfo" and "Automatic AllAttributes
     //  PersonInfo" templates/views.
     //As for now (2006 mar) - there is no more even "Container" template : output is hardcoded
     //  to wrap and return single tag:
     ////        $retval = $this->templateFiller->fill("Container");
     /*        $ResultTableRows = $this->getTag($this->HTML_TAGS_PREFIX . 'InputAllAttributesRows');
             $ResultJavascriptFunctions = $this->getTag($this->HTML_TAGS_PREFIX . 'JavascriptFunctions');
             //The name of the outputted data block is passed as a hidden field,
             // to know what data should have come to Action, and how to check it.
             $HiddenField = "<input type=\"hidden\" name=\"". $this->getTag("SubmitedCheckoutStoreBlocksListItemName") . "\">";
     
     ///        $retval =
                   $ResultTableRows . "\n"
     //            .'</table>';
     //: can a javascript code be added the same way? For example, if templates
     // are table strings, the whole template is a few concatenated table strings,
     //  and appended to the end a javascript code, then wouldn't it result in
     // changing the table structure?
                 . $ResultJavascriptFunctions
                 . $HiddenField;
     */
     $retval = $this->templateFiller->fill("InputContainer");
     return $retval;
 }