/**
  * Outputs the form field for the given params
  */
 function outputField($field_type, $field_name, $def_value, $onchange = '', $id = '')
 {
     $return_value = '';
     switch ($field_type) {
         case 'hidden':
             $return_value = '<input type="hidden"' . HtmlForm::genHiddenField($field_name, $def_value) . ' id="' . $field_name . '" />';
             break;
         case 'rate':
             $return_value = '<input type="text"' . HtmlForm::genInputTextField('255', $field_name, '70', $def_value, $onchange . 'style="width: 98%;" class="form-control input-sm input-large"') . ' />';
             break;
         case 'visible':
             $return_value = HtmlForm::genDropdownSingleChoice(array("select_name" => $field_name, "selected_value" => $def_value, "onChange" => $onchange, "values" => array(array('value' => 'Y', 'contents' => getMsg('CR', 'CR_SHOW')), array('value' => 'N', 'contents' => getMsg('CR', 'CR_HIDE')))));
             break;
         case 'checkbox':
             $return_value = HtmlForm::genCheckbox(array("value" => $def_value, "name" => $field_name, "onclick" => $onchange, "id" => $id, "is_checked" => ''));
             break;
     }
     return $return_value;
 }
 /**
  * The main function to output the viewer content.
  */
 function output()
 {
     global $application;
     // getting the languages
     $lng = modApiFunc('Request', 'getValueByKey', 'lng');
     // if language is invalid -> change it to default
     if (!modApiFunc('MultiLang', 'checkLanguage', $lng, false)) {
         $lng = modApiFunc('MultiLang', 'getDefaultLanguage');
     }
     $label_id = modApiFunc('Request', 'getValueByKey', 'label_id');
     $Label_Data = array();
     if (!$label_id) {
         $label_id = 0;
     } else {
         $Label_Data = modApiFunc('MultiLang', 'searchLabels', array('label_id' => $label_id, 'lng' => $lng));
     }
     // getting label data
     if (!empty($Label_Data)) {
         // label_id is specified and valid
         $Label_Data = array_pop($Label_Data);
     } else {
         // label_id is either not specified or not valid
         // assuming adding a new custom label
         $Label_Data = array('label' => 'CUSTOM_', 'prefix' => 'CZ');
     }
     // restoring label data from session if any
     // use case: restoring submitted from with an error
     if (modApiFunc('Session', 'is_set', 'SavedLabelData')) {
         $Label_Data = modApiFunc('Session', 'get', 'SavedLabelData');
         modApiFunc('Session', 'un_set', 'SavedLabelData');
     }
     // getting label information
     $Label_Data = modApiFunc('MultiLang', 'getLabelInformation', $Label_Data, '', $lng);
     $template_contents = array('ResultMessage' => $this->outputResultMessage(), 'PageJSCode' => $this->outputJSCode(), 'ActionField' => '<input type="hidden" ' . HtmlForm::genHiddenField('asc_action', 'ML_UpdateLabelData') . ' />', 'LabelIDField' => '<input type="hidden" ' . HtmlForm::genHiddenField('label_data[id]', @$Label_Data['id']) . ' />', 'LanguageField' => '<input type="hidden" ' . HtmlForm::genHiddenField('lng', $lng) . ' />', 'LabelData' => $this->outputLabelData($Label_Data, $lng), 'EditPageTitle' => @$Label_Data['id'] > 0 ? getMsg('ML', 'ML_EDIT_LABEL') : getMsg('ML', 'ML_ADD_LABEL'));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('multilang/label_data/', 'container.tpl.html', array());
 }
 function getHiddenFiled()
 {
     $HtmlForm = new HtmlForm();
     return $HtmlForm->genHiddenField('asc_action', 'SaveSortedProducts');
 }
 /**
  * @ describe the function ProductList->getTag.
  */
 function getTag($tag)
 {
     global $application;
     $value = null;
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     switch ($tag) {
         case 'HiddenArrayViewState':
             $value = $this->outputViewState();
             break;
         case 'HiddenFieldAction':
             $value = $HtmlForm->genHiddenField('asc_action', 'UpdateCreditCardSettings');
             break;
         case 'OptionsList':
             $value = $this->outputOptionsList();
             break;
         case 'OptionsListHidden':
             $OptionsListHiddenArray = $this->getOptionsListHiddenArray();
             $value = implode('|', $OptionsListHiddenArray);
             break;
         case 'SaveSortHref':
             $value = $this->outputSaveSortHref();
             break;
     }
     return $value;
 }
 /**
  * Return the "PromoCodes -> Add Promo Code" view html code.
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->Hints =& $application->getInstance('Hint');
     $HtmlForm1 = new HtmlForm();
     $this->MessageResources =& $application->getInstance('MessageResources', "promo-codes-messages", "AdminZone");
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "closeChild_UpdateParent");
     }
     //        $promo_code_summary = ;
     $promo_code_order_list = $this->outputOrderList();
     $this->_Template_Contents = array("OrderList" => $promo_code_order_list);
     $application->registerAttributes($this->_Template_Contents);
     $template_contents = array("Subtitle" => $this->outputSubtitle(), "Errors" => $this->outputErrors(), "PromoCodeId" => $this->outputPromoCodeId(), "PromoCodeSummary" => $this->outputPromoCodeSummary(), "PromoCodeEffectiveAreaLaconic" => $this->outputEffectiveAreaLaconic(), "OrderList" => $promo_code_order_list, "PromoCodeCampaignNameError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_001']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_001'] : "", "PromoCodeCampaignNameInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_001']) ? "error" : "", "PromoCodeCampaignName" => $HtmlForm1->genInputTextField("128", "PromoCodeCampaignName", "75", prepareHTMLDisplay($this->POST["PromoCodeCampaignNameText"])), "PromoCodeCampaignFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_CAMPAIGN_NAME_NAME', 'promo-codes-messages')), "PromoCodePromoCodeError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_002']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_002'] : "", "PromoCodePromoCodeInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_002']) ? "error" : "", "PromoCodePromoCode" => $HtmlForm1->genInputTextField("128", "PromoCodePromoCode", "75", prepareHTMLDisplay($this->POST["PromoCodePromoCodeText"])), "PromoCodePromoCodeFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_PROMO_CODE_NAME', 'promo-codes-messages')), "PromoCodeStatusError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_004']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_004'] : "", "PromoCodeStatusInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_004']) ? "error" : "", "PromoCodeStatus" => $this->outputStatus(), "PromoCodeStatusFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_STATUS_NAME', 'promo-codes-messages')), "PromoCodeMinSubtotalError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_005']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_005'] : "", "PromoCodeMinSubtotalInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_005']) ? "error" : "", "PromoCodeMinSubtotal" => $HtmlForm1->genInputTextField("10", "PromoCodeMinSubtotal", "10", prepareHTMLDisplay($this->POST["PromoCodeMinSubtotalText"])), "PromoCodeMinSubtotalFormat" => modApiFunc("Localization", "format_settings_for_js", "currency"), "PromoCodeMinSubtotalSign" => modApiFunc("Localization", "getCurrencySign"), "PromoCodeMinSubtotalFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_MIN_SUBTOTAL_NAME', 'promo-codes-messages')), "PromoCodeDiscountCostError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_006']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_006'] : "", "PromoCodeDiscountCostInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_006']) ? "error" : "", "PromoCodeDiscountCost" => $HtmlForm1->genInputTextField("10", "PromoCodeDiscountCost", "10", prepareHTMLDisplay($this->POST["PromoCodeDiscountCostText"])), "PromoCodeDiscountCostFormat" => modApiFunc("Localization", "format_settings_for_js", "currency"), "PromoCodeDiscountCostFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_DISCOUNT_COST_NAME', 'promo-codes-messages')), "PromoCodeDiscountCostTypeIDError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_007']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_007'] : "", "PromoCodeDiscountCostTypeIDInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_007']) ? "error" : "", "PromoCodeDiscountCostTypeID" => $this->outputDiscountCostTypeID(), "PromoCodeStartDateFYearError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_008']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_008'] : "", "PromoCodeStartDateFYearInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_008']) ? "error" : "", "PromoCodeStartDateFYear" => $this->outputFYear("StartDate"), "PromoCodeStartDateFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_START_DATE_NAME', 'promo-codes-messages')), "PromoCodeStartDateMonthError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_009']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_009'] : "", "PromoCodeStartDateMonthInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_009']) ? "error" : "", "PromoCodeStartDateMonth" => $this->outputMonth("StartDate"), "PromoCodeStartDateDayError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_010']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_010'] : "", "PromoCodeStartDateDayInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_010']) ? "error" : "", "PromoCodeStartDateDay" => $this->outputDay("StartDate"), "PromoCodeEndDateFYearError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_011']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_011'] : "", "PromoCodeEndDateFYearInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_011']) ? "error" : "", "PromoCodeEndDateFYear" => $this->outputFYear("EndDate"), "PromoCodeEndDateFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_END_DATE_NAME', 'promo-codes-messages')), "PromoCodeEndDateMonthError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_012']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_012'] : "", "PromoCodeEndDateMonthInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_012']) ? "error" : "", "PromoCodeEndDateMonth" => $this->outputMonth("EndDate"), "PromoCodeEndDateDayError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_013']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_013'] : "", "PromoCodeEndDateDayInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_013']) ? "error" : "", "PromoCodeEndDateDay" => $this->outputDay("EndDate"), "PromoCodeTimesToUseError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_014']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_014'] : "", "PromoCodeTimesToUseInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_014']) ? "error" : "", "PromoCodeTimesToUse" => $HtmlForm1->genInputTextField("10", "PromoCodeTimesToUse", "10", prepareHTMLDisplay($this->POST["PromoCodeTimesToUseText"])), "PromoCodeTimesToUseFormat" => modApiFunc("Localization", "format_settings_for_js", "item"), "PromoCodeTimesToUseFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_TIMES_TO_USE_NAME', 'promo-codes-messages')), "PromoCodeBIgnoreOtherDiscountsError" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_003']) ? $this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_003'] : "", "PromoCodeBIgnoreOtherDiscountsInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_PROMOCODES_ADD_PROMO_CODE_003']) ? "error" : "", "PromoCodeBIgnoreOtherDiscounts" => $this->outputBIgnoreOtherDiscounts(), "PromoCodeBIgnoreOtherDiscountsFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_B_IGNORE_OTHER_DISCOUNTS_NAME', 'promo-codes-messages')), "PromoCodeOffersFreeShippingFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_OFFERS_FREE_SHIPPING_NAME', 'promo-codes-messages')), "PromoCodeOffersFreeShippingOptions" => $this->outputFreeShippingOptions(), "PromoCodeOffersFreeHandlingFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_OFFERS_FREE_HANDLING_NAME', 'promo-codes-messages')), "PromoCodeOffersFreeHandlingOptions" => $this->outputFreeHandlingOptions(), "PromoCodeStrictCartFieldHint" => $this->Hints->getHintLink(array('PROMO_CODE_STRICT_CART_NAME', 'promo-codes-messages')), "PromoCodeStrictCartOptions" => $this->outputStrictCartOptions(), "AddPromoCodeForm" => $HtmlForm1->genForm(modApiFunc("application", "getPagenameByViewname", "PromoCodesNavigationBar", -1, -1, 'AdminZone'), "POST", "AddPromoCodeForm"), "HiddenFormSubmitValue" => $HtmlForm1->genHiddenField("FormSubmitValue", "Save"), "HiddenArrayViewStateConstants" => $this->outputViewStateConstants(), "HiddenArrayViewState" => $this->outputViewState(), "SubmitSaveScript" => $HtmlForm1->genSubmitScript("AddPromoCodeForm"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $SpecMessageResources =& $application->getInstance('MessageResources');
     //: correct error codes
     $output = modApiFunc('TmplFiller', 'fill', './../../js/', 'validate.msgs.js.tpl', array("STRING1024" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_001'))), "STRING128" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_002'))), "STRING256" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_003'))), "STRING512" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_004'))), "INTEGER" => $SpecMessageResources->getMessage(new ActionMessage(array('PRDADD_001'))), "FLOAT" => $SpecMessageResources->getMessage(new ActionMessage(array('PRDADD_002'))), "CURRENCY" => addslashes($SpecMessageResources->getMessage(new ActionMessage(array('CURRENCY_FIELD', modApiFunc("Localization", "FloatToFormatStr", 12.35, "currency"), modApiFunc("Localization", "FloatToFormatStr", 34, "currency"), modApiFunc("Localization", "FloatToFormatStr", 99.0, "currency"))))), "WEIGHT" => addslashes($SpecMessageResources->getMessage(new ActionMessage(array('WEIGHT_FIELD', modApiFunc("Localization", "FloatToFormatStr", 23.325, "weight"), modApiFunc("Localization", "FloatToFormatStr", 34, "weight"), modApiFunc("Localization", "FloatToFormatStr", 99.2, "weight"))))), "ITEM" => $SpecMessageResources->getMessage(new ActionMessage(array('ITEM_FIELD')))));
     return $output . $this->mTmplFiller->fill("promo_codes/add_promo_code/", "list.tpl.html", array());
 }
 /**
  *                     ViewState
  */
 function outputViewStateConstants()
 {
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $retval = "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("asc_action", "UpdateFsRuleInfo") . ">";
     $retval .= "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("FsRule_id", $this->POST["FsRule_id"]) . ">";
     return $retval;
 }
 /**
  * Outputs hidden fields
  */
 function outputHiddenData()
 {
     return '<input type="hidden"' . HtmlForm::genHiddenField('asc_action', 'UpdateLanguages') . ' />' . '<input type="hidden"' . HtmlForm::genHiddenField('mode', 'update') . ' />';
 }
 /**
  * @ describe the function ProductList->getTag.
  */
 function getTag($tag)
 {
     global $application;
     $value = "";
     $CatID = $this->getCategoryID();
     $full_path_arr = modApiFunc('Catalog', 'getCategoryFullPath', $CatID);
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     switch ($tag) {
         case 'HiddenArrayViewState':
             $value = $this->outputViewState();
             break;
         case 'asc_action':
             $value = $this->outputAction();
             break;
         case 'Items':
             if ($CatID != NULL) {
                 $value = $this->outputListItems($CatID);
             }
             break;
         case 'HiddenFieldAction':
             $value = $HtmlForm->genHiddenField('asc_action', $this->outputAction());
             break;
         case 'HiddenFieldCatsId':
             $value = $HtmlForm->genHiddenField('CatsId', implode("|", $this->CatsId));
             break;
         case 'HiddenFieldProdsId':
             $value = $HtmlForm->genHiddenField('ProdsId', implode("|", $this->ProdsId));
             break;
         case 'Category_Path':
             $value = $this->outputLocationBreadcrumb($full_path_arr, false);
             break;
         case 'Delete_Warning':
             $value = $this->outputDeleteWarning(prepareHTMLDisplay($full_path_arr[sizeof($full_path_arr) - 1]['name']));
             break;
         case 'DeleteCatHref':
             $value = $this->outputDeleteHref();
             break;
         case 'Delete_Object':
             $value = $this->outputDeleteObject();
             break;
         case 'Delete_Subject':
             $value = $this->outputDeleteSubject();
             break;
         case 'Category_Full_Name':
             $value = $this->_Current_Category->getCategoryTagValue('Category_Full_Name');
             break;
         case 'ProductDelMessage':
             $cats_ids = $this->_Current_Product->getCategoriesIDs();
             if (count($cats_ids) == 1 || modApiFunc('Session', 'is_set', 'SearchProductFormFilter')) {
                 $value = getMsg('CTL', 'MSG_REAL_PRODUCT_DEL');
             } else {
                 unset($cats_ids[array_search($CatID, $cats_ids)]);
                 $strings = array();
                 foreach ($cats_ids as $cat_id) {
                     $full_path = modApiFunc('Catalog', 'getCategoryFullPath', $cat_id);
                     $names = array();
                     foreach ($full_path as $pci) {
                         $names[] = $pci['name'];
                     }
                     $strings[] = implode("/", $names);
                 }
                 $value = getMsg('CTL', 'MSG_LINK_PRODUCT_DEL', implode("<br>", $strings));
             }
             break;
         default:
             if (_ml_strpos($tag, 'Category') === 0) {
                 $stag = _ml_substr($tag, _ml_strlen('Category'));
                 if (is_object($this->_Current_Category) && $this->_Current_Category->isTagExists($tag)) {
                     $value = $this->_Current_Category->getCategoryTagValue($tag);
                     break;
                 }
             }
             if (_ml_strpos($tag, 'Product') === 0) {
                 $stag = _ml_substr($tag, _ml_strlen('Product'));
                 if (is_object($this->_Current_Product) && $this->_Current_Product->isTagExists($stag)) {
                     $value = $this->_Current_Product->getProductTagValue($stag);
                     break;
                 }
             }
             if (is_object($this->_Current_Category) && $this->_Current_Category->isTagExists($tag)) {
                 $value = $this->_Current_Category->getCategoryTagValue($tag);
             }
             if (is_object($this->_Current_Product) && $this->_Current_Product->isTagExists($tag)) {
                 $value = $this->_Current_Product->getProductTagValue($tag);
             }
             break;
     }
     return $value;
 }
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Items':
             $value = $this->getModulesList();
             break;
         case 'ShippingModulesList':
             $value = "Shipping Modules List";
             break;
             /*            case 'SubmitedCheckoutStoreBlocksListItemName':
                           $value = "SubmitedCheckoutStoreBlocksList[shipping-method-list-input]";
                           break;*/
         /*            case 'SubmitedCheckoutStoreBlocksListItemName':
                       $value = "SubmitedCheckoutStoreBlocksList[shipping-method-list-input]";
                       break;*/
         case 'List_SelectedModules':
             $items = array();
             $SelectedModules = modApiFunc("Checkout", "getSelectedModules", "shipping");
             $new_selected_module_sort_order = 0;
             $modules = $this->getInstalledModulesListData();
             foreach ($modules as $module) {
                 $name = _ml_strtolower($module->name);
                 $Shipping_group = modApiFunc("Checkout", "getShippingModuleGroup", $module);
                 if ($Shipping_group != '') {
                     $smInfo = modApiFunc($name, "getInfo");
                     //// INCORRECT method to get group name! Remove group name from id at all.
                     //$groups_array = explode(',', $module->groups);
                     if (array_key_exists($smInfo['GlobalUniqueShippingModuleID'], $SelectedModules)) {
                         $ShippingModulesGroupsInfo = modApiFunc("Checkout", "getShippingModulesGroupsInfo");
                         //If sort id is not defined then assign the highest possible sort id to this item: 0, -1, -2 ...
                         $sort_id = empty($SelectedModules[$smInfo["GlobalUniqueShippingModuleID"]]["sort_order"]) ? $new_selected_module_sort_order-- : $SelectedModules[$smInfo["GlobalUniqueShippingModuleID"]]["sort_order"];
                         $items[$sort_id] = "<option value=\"" . $smInfo['GlobalUniqueShippingModuleID'] . "\" id=\"" . $smInfo['GlobalUniqueShippingModuleID'] . "\">" . prepareHTMLDisplay($smInfo["Name"]) . "</option>";
                     }
                 }
             }
             //Sort items by sort id and implode them.
             ksort($items, SORT_NUMERIC);
             $value = implode("", $items);
             break;
         case 'HiddenSelectedModules':
             //Hidden field to store selected ("Selected Shipping Modules") select state
             $value = "";
             $SelectedModules = modApiFunc("Checkout", "getSelectedModules", "shipping");
             $new_selected_module_sort_order = 0;
             $modules = $this->getInstalledModulesListData();
             foreach ($modules as $module) {
                 $name = _ml_strtolower($module->name);
                 $Shipping_group = modApiFunc("Checkout", "getShippingModuleGroup", $module);
                 if ($Shipping_group != '') {
                     $smInfo = modApiFunc($name, "getInfo");
                     //// INCORRECT method to get group name! Remove group name from id at all.
                     //$groups_array = explode(',', $module->groups);
                     if (array_key_exists($smInfo['GlobalUniqueShippingModuleID'], $SelectedModules)) {
                         $ShippingModulesGroupsInfo = modApiFunc("Checkout", "getShippingModulesGroupsInfo");
                         //If sort id is not defined then assign the highest possible sort id to this item: 0, -1, -2 ...
                         $sort_id = empty($SelectedModules[$smInfo["GlobalUniqueShippingModuleID"]]["sort_order"]) ? $new_selected_module_sort_order-- : $SelectedModules[$smInfo["GlobalUniqueShippingModuleID"]]["sort_order"];
                         $value .= $value == "" ? $smInfo['GlobalUniqueShippingModuleID'] : "," . $smInfo['GlobalUniqueShippingModuleID'];
                     }
                 }
             }
             break;
         case 'SaveSelectedShippingModulesListHref':
             ////                $request = new Request();
             ////                $request->setView  ('CheckoutShippingModulesList');
             $value = $application->getPagenameByViewname("StoreSettingsPage", -1, -1, 'AdminZone');
             //////: should set action?
             ////                $request->setAction('SaveSelectedShippingModulesList');
             ////                $value = modApiFunc('application', 'href', $request);
             break;
         case 'HiddenFieldAction':
             loadCoreFile('html_form.php');
             $HtmlForm = new HtmlForm();
             $value = $HtmlForm->genHiddenField('asc_action', 'SaveSelectedShippingModulesList');
             break;
         case 'HiddenArrayViewState':
             break;
         case 'getShippingModuleInfoItemsJS':
             $value = "";
             $modules = $this->getInstalledModulesListData();
             foreach ($modules as $module) {
                 $name = _ml_strtolower($module->name);
                 $pmInfo = modApiFunc($name, "getInfo");
                 $Shipping_group = modApiFunc("Checkout", "getShippingModuleGroup", $module);
                 if ($Shipping_group != '') {
                     $ShippingModulesGroupsInfo = modApiFunc("Checkout", "getShippingModulesGroupsInfo");
                     $value .= "case '" . $pmInfo['GlobalUniqueShippingModuleID'] . "': switch(key){case 'ShippingModulesGroupID': value = '" . $Shipping_group . "'; break; case 'ShortName': value ='" . $pmInfo["Name"] . "'; break; case 'FullName': value ='" . $pmInfo["Name"] . "'; break;}; break;";
                     //e.g. ShippingModulesGroupID = OnlineCC
                     //     ShortName             = Paypal
                     //     FullName              = [Online CC]Paypal
                     //Notice whitespace in "[Online CC]"
                 }
             }
             break;
         case 'getShippingModuleGroupsItemsJS':
             $value = "";
             $ShippingModulesGroupsInfo = modApiFunc("Checkout", "getShippingModulesGroupsInfo");
             $bFirstItem = true;
             foreach ($ShippingModulesGroupsInfo as $ShippingModulesGroupInfo) {
                 if ($bFirstItem) {
                     $value .= "'" . $ShippingModulesGroupInfo['group_id'] . "'";
                     $bFirstItem = false;
                 } else {
                     $value .= ", '" . $ShippingModulesGroupInfo['group_id'] . "'";
                 }
             }
             break;
         case 'ShippingModulesLink':
             $request = new Request();
             $request->setView(CURRENT_REQUEST_URL);
             $value = $request->getURL();
             break;
         case 'ResultMessageRow':
             $value = $this->outputResultMessage();
             break;
         case 'ResultMessage':
             $value = $this->_Template_Contents['ResultMessage'];
             break;
         default:
             $value = "";
             $pos = _ml_strpos($tag, "_");
             if ($pos != FALSE) {
                 $prefix = _ml_substr($tag, 0, $pos);
                 switch ($prefix) {
                     case "ShippingModuleCheckGroupList":
                         //Options for "Offline" "Online CC" "Online eCheck" and "Online Shipping" <select> control.
                         $SelectedModules = modApiFunc("Checkout", "getSelectedModules", "shipping");
                         $group_name = _ml_substr($tag, _ml_strlen($prefix) + 1);
                         $modules = $this->getInstalledModulesListData(array($group_name));
                         $free_shipping_sm_guid = modApiFunc('Shipping_Module_Free_Shipping', 'getUID');
                         foreach ($modules as $module) {
                             $name = _ml_strtolower($module->name);
                             $pmInfo = modApiFunc($name, "getInfo");
                             if ($pmInfo['GlobalUniqueShippingModuleID'] == $free_shipping_sm_guid) {
                                 continue;
                             }
                             $value .= "<ul id='isSelect' class='list-inline'><li style='list-style-type: none;'>";
                             if (array_key_exists($pmInfo['GlobalUniqueShippingModuleID'], $SelectedModules)) {
                                 $value .= "<label id='module-name'><input type='checkbox' class='checkbox-inline' name='sel_shipping' value='" . $pmInfo['GlobalUniqueShippingModuleID'] . "' id='chk_" . $pmInfo['GlobalUniqueShippingModuleID'] . "' style='margin: 0px 0px 2px;' checked>" . prepareHTMLDisplay($pmInfo["Name"]) . "</label></li></ul>";
                             } else {
                                 $value .= "<label id='module-name'><input type='checkbox' class='checkbox-inline' name='sel_shipping' value='" . $pmInfo['GlobalUniqueShippingModuleID'] . "' id='chk_" . $pmInfo['GlobalUniqueShippingModuleID'] . "' style='margin: 0px 0px 2px;'>" . prepareHTMLDisplay($pmInfo["Name"]) . "</label></li></ul>";
                             }
                         }
                         break;
                     case "ShippingModuleGroupList":
                         //Options for "Offline" "Online CC" "Online eCheck" and "Online Shipping" <select> control.
                         $SelectedModules = modApiFunc("Checkout", "getSelectedModules", "shipping");
                         $group_name = _ml_substr($tag, _ml_strlen($prefix) + 1);
                         $modules = $this->getInstalledModulesListData(array($group_name));
                         $free_shipping_sm_guid = modApiFunc('Shipping_Module_Free_Shipping', 'getUID');
                         foreach ($modules as $module) {
                             $name = _ml_strtolower($module->name);
                             $pmInfo = modApiFunc($name, "getInfo");
                             if ($pmInfo['GlobalUniqueShippingModuleID'] == $free_shipping_sm_guid) {
                                 continue;
                             }
                             if (!array_key_exists($pmInfo['GlobalUniqueShippingModuleID'], $SelectedModules)) {
                                 $value .= "<option value=\"" . $pmInfo['GlobalUniqueShippingModuleID'] . "\">" . prepareHTMLDisplay($pmInfo["Name"]) . "</option>";
                             }
                         }
                         break;
                     case "HiddenAvailable":
                         break;
                     default:
                         ////// can it be Current Module (Modules List Item) details?
                         ////_fatal(__CLASS__ .'::'. __FUNCTION__. ': prefix = ' . $prefix);
                         break;
                 }
             } else {
                 //Current Module (Modules List Item) details
                 $value = getKeyIgnoreCase($tag, $this->_Current_Module);
             }
             break;
     }
     return $value;
 }
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Items':
             $value = $this->getModulesList();
             break;
         case 'List_SelectedModules':
             $value = "";
             $SelectedModules = $this->getSelectedPaymentModules();
             $new_selected_module_sort_order = 0;
             $modules = $this->getPaymentModulesListPrepared();
             foreach ($modules as $module) {
                 $label = $module['module_label_name'];
                 $payment_group = $module['payment_group'];
                 $uid = $module['uid'];
                 $group_short_name = $module['group_short_name'];
                 if (array_key_exists($uid, $SelectedModules)) {
                     //If sort id is not defined then assign the highest possible sort id to this item: 0, -1, -2 ...
                     $sort_id = empty($SelectedModules[$uid]["sort_order"]) ? $new_selected_module_sort_order-- : $SelectedModules[$uid]["sort_order"];
                     $items[$sort_id] = "<option value=\"" . $uid . "\" id=\"" . $uid . "\">" . "[" . $group_short_name . "] " . prepareHTMLDisplay($label) . "</option>";
                 }
             }
             //Sort items by sort id and implode them.
             if (!empty($items)) {
                 ksort($items, SORT_NUMERIC);
                 $value = implode("", $items);
             }
             break;
         case 'HiddenSelectedModules':
             //Hidden field to store selected ("Selected Payment Modules") select state
             $value = "";
             $SelectedModules = $this->getSelectedPaymentModules();
             $new_selected_module_sort_order = 0;
             $modules = $this->getPaymentModulesListPrepared();
             foreach ($modules as $module) {
                 $payment_group = $module['payment_group'];
                 $uid = $module['uid'];
                 if (array_key_exists($uid, $SelectedModules)) {
                     //If sort id is not defined then assign the highest possible sort id to this item: 0, -1, -2 ...
                     $sort_id = empty($SelectedModules[$uid]["sort_order"]) ? $new_selected_module_sort_order-- : $SelectedModules[$uid]["sort_order"];
                     $value .= $value == "" ? $uid : "," . $uid;
                 }
             }
             break;
         case 'SaveSelectedPaymentModulesListHref':
             $value = $application->getPagenameByViewname("StoreSettingsPage", -1, -1, 'AdminZone');
             break;
         case 'HiddenFieldAction':
             loadCoreFile('html_form.php');
             $HtmlForm = new HtmlForm();
             $value = $HtmlForm->genHiddenField('asc_action', 'SaveSelectedPaymentModulesList');
             break;
         case 'HiddenArrayViewState':
             break;
         case 'getPaymentModuleInfoItemsJS':
             $value = "";
             $modules = $this->getPaymentModulesListPrepared();
             foreach ($modules as $module) {
                 $value .= "case '" . $module['uid'] . "': switch(key){case 'PaymentModulesGroupID': value = '" . $module['payment_group'] . "'; break; case 'ShortName': value ='" . addslashes($module['module_label_name']) . "'; break; case 'FullName': value ='[" . $module['group_short_name'] . "] " . addslashes($module['module_label_name']) . "'; break;}; break;\n";
                 //e.g. PaymentModulesGroupID = OnlineCC
                 //     ShortName             = Paypal
                 //     FullName              = [Online CC] Paypal
                 //Notice whitespace in "[Online CC]"
             }
             break;
         case 'getPaymentModuleGroupsItemsJS':
             $value = "";
             $PaymentModulesGroupsInfo = modApiFunc("Checkout", "getPaymentModulesGroupsInfo");
             $bFirstItem = true;
             foreach ($PaymentModulesGroupsInfo as $PaymentModulesGroupInfo) {
                 if ($bFirstItem) {
                     $value .= "'" . $PaymentModulesGroupInfo['group_id'] . "'";
                     $bFirstItem = false;
                 } else {
                     $value .= ", '" . $PaymentModulesGroupInfo['group_id'] . "'";
                 }
             }
             break;
         case 'PaymentModulesLink':
             $request = new Request();
             $request->setView(CURRENT_REQUEST_URL);
             $value = $request->getURL();
             break;
         case 'ResultMessageRow':
             $value = $this->outputResultMessage();
             break;
         case 'ResultMessage':
             $value = $this->_Template_Contents['ResultMessage'];
             break;
         default:
             $value = "";
             $pos = _ml_strpos($tag, "_");
             if ($pos != FALSE) {
                 $prefix = _ml_substr($tag, 0, $pos);
                 switch ($prefix) {
                     case "PaymentModuleCheckGroupList":
                         $groups = array(0 => 'Offline', 1 => 'OnlineCC', 2 => 'OnlineECheck');
                         $titles = array(0 => 'PAYM_METH_HEADER_005', 1 => 'PAYM_METH_HEADER_006', 2 => 'PAYM_METH_HEADER_007');
                         $SelectedModules = $this->getSelectedPaymentModules();
                         $modules = $this->getPaymentModulesListPrepared();
                         for ($cgr = 0; $cgr < 3; $cgr++) {
                             $value .= "<li style='list-style-type:none;' id='optgroup_" . $groups[$cgr] . "_id'><b>" . getMsg('SYS', $titles[$cgr]) . "</b></li>";
                             reset($modules);
                             foreach ($modules as $module) {
                                 if ($module['payment_group'] != $groups[$cgr]) {
                                     continue;
                                 }
                                 $name = $module['module_label_name'];
                                 $uid = $module['uid'];
                                 $value .= "<ul id='isSelect' class='list-inline'><li style='list-style-type: none;'>";
                                 if (array_key_exists($uid, $SelectedModules)) {
                                     $value .= "<label id='module-name'><input type='checkbox' class='checkbox-inline' name='sel_payment' value='" . $uid . "' id='chk_" . $uid . "' style='margin: 0px 0px 2px;' checked>" . prepareHTMLDisplay($name) . "</label></li></ul>";
                                 } else {
                                     $value .= "<label id='module-name'><input type='checkbox' class='checkbox-inline' name='sel_payment' value='" . $uid . "' id='chk_" . $uid . "' style='margin: 0px 0px 2px;'>" . prepareHTMLDisplay($name) . "</label></li></ul>";
                                 }
                             }
                         }
                         break;
                     case "PaymentModuleGroupList":
                         $groups = array(0 => 'Offline', 1 => 'OnlineCC', 2 => 'OnlineECheck');
                         $titles = array(0 => 'PAYM_METH_HEADER_005', 1 => 'PAYM_METH_HEADER_006', 2 => 'PAYM_METH_HEADER_007');
                         //Options for "Offline" "Online CC" "Online eCheck" and "Online Payment" <select> control.
                         $SelectedModules = $this->getSelectedPaymentModules();
                         $modules = $this->getPaymentModulesListPrepared();
                         for ($cgr = 0; $cgr < 3; $cgr++) {
                             $value .= "<optgroup label='" . getMsg('SYS', $titles[$cgr]) . "' id='optgroup_" . $groups[$cgr] . "_id'>";
                             reset($modules);
                             foreach ($modules as $module) {
                                 if ($module['payment_group'] != $groups[$cgr]) {
                                     continue;
                                 }
                                 $name = $module['module_label_name'];
                                 $uid = $module['uid'];
                                 if (!array_key_exists($uid, $SelectedModules)) {
                                     $value .= "<option value=\"" . $uid . "\">" . prepareHTMLDisplay($name) . "</option>";
                                 }
                             }
                             $value .= '</optgroup>';
                         }
                         break;
                     case "HiddenAvailable":
                         break;
                     default:
                         ////// can it be Current Module (Modules List Item) details?
                         ////_fatal(__CLASS__ .'::'. __FUNCTION__. ': prefix = ' . $prefix);
                         break;
                 }
             } else {
                 //Current Module (Modules List Item) details
                 $value = getKeyIgnoreCase($tag, $this->_Current_Module);
             }
             break;
     }
     return $value;
 }
Exemplo n.º 11
0
 /**
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->Hints =& $application->getInstance('Hint');
     $HtmlForm1 = new HtmlForm();
     $this->MessageResources =& $application->getInstance('MessageResources', "shipping-cost-calculator-messages", "AdminZone");
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "UpdateParentsParent");
         //modApiFunc("application", "closeChild_UpdateParent");
     }
     $request = new Request();
     $request->setView("EditFsRule");
     $request->setAction($this->getAction());
     $form_url = $request->getURL();
     $template_contents = array("Subtitle" => $this->outputSubtitle(), "Errors" => $this->outputErrors(), "FsRuleNameError" => isset($this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_001']) ? $this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_001'] : "", "FsRuleNameInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_001']) ? "error" : "", "FsRuleName" => $HtmlForm1->genInputTextField("128", "FsRuleName", "50", prepareHTMLDisplay($this->POST["FsRuleName"])), "FsRuleFieldHint" => $this->Hints->getHintLink(array('SCC_FSTABLE_RULE_NAME_LABEL', 'shipping-cost-calculator-messages')), "FsRuleEffectiveAreaLaconic" => $this->outputEffectiveAreaLaconic(), "FsRuleStrictCartSelect" => $this->outputFsRuleStrictCartSelect(), "FsRuleMinSubtotalError" => isset($this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_005']) ? $this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_005'] : "", "FsRuleMinSubtotalInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_SCC_ADD_PROMO_CODE_005']) ? "error" : "", "FsRuleMinSubtotal" => $HtmlForm1->genInputTextField("10", "FsRuleMinSubtotal", "10", prepareHTMLDisplay($this->POST["FsRuleMinSubtotal"])), "FsRuleMinSubtotalFormat" => modApiFunc("Localization", "format_settings_for_js", "currency"), "FsRuleMinSubtotalSign" => modApiFunc("Localization", "getCurrencySign"), "FsRuleMinSubtotalFieldHint" => $this->Hints->getHintLink(array('SCC_MIN_SUBTOTAL_LABEL', 'shipping-cost-calculator-messages')), "AddFsRuleForm" => $HtmlForm1->genForm($form_url, "POST", "AddFsRuleForm"), "HiddenFormSubmitValue" => $HtmlForm1->genHiddenField("FormSubmitValue", "Save"), "HiddenArrayViewStateConstants" => $this->outputViewStateConstants(), "HiddenArrayViewState" => $this->outputViewState(), "SubmitSaveScript" => $HtmlForm1->genSubmitScript("AddFsRuleForm"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $SpecMessageResources =& $application->getInstance('MessageResources');
     //: correct error codes
     $output = '';
     $output = modApiFunc('TmplFiller', 'fill', './../../js/', 'validate.msgs.js.tpl', array("STRING1024" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_001'))), "STRING128" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_002'))), "STRING256" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_003'))), "STRING512" => $SpecMessageResources->getMessage(new ActionMessage(array('CATADD_004'))), "INTEGER" => $SpecMessageResources->getMessage(new ActionMessage(array('PRDADD_001'))), "FLOAT" => $SpecMessageResources->getMessage(new ActionMessage(array('PRDADD_002'))), "CURRENCY" => addslashes($SpecMessageResources->getMessage(new ActionMessage(array('CURRENCY_FIELD', modApiFunc("Localization", "FloatToFormatStr", 12.35, "currency"), modApiFunc("Localization", "FloatToFormatStr", 34, "currency"), modApiFunc("Localization", "FloatToFormatStr", 99.0, "currency"))))), "WEIGHT" => addslashes($SpecMessageResources->getMessage(new ActionMessage(array('WEIGHT_FIELD', modApiFunc("Localization", "FloatToFormatStr", 23.325, "weight"), modApiFunc("Localization", "FloatToFormatStr", 34, "weight"), modApiFunc("Localization", "FloatToFormatStr", 99.2, "weight"))))), "ITEM" => $SpecMessageResources->getMessage(new ActionMessage(array('ITEM_FIELD')))));
     return $output . $this->mTmplFiller->fill("shipping_cost_calculator/add_fs_rule/", "list.tpl.html", array());
 }
 /**
  * Outputs form contents.
  */
 function output()
 {
     global $application;
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "closeChild");
         return;
     }
     $obj =& $application->getInstance('MessageResources');
     $uid = modApiFunc("Users", "getSelectedUserID");
     $admin_info = modApiFunc("Users", "getUserInfo", $uid);
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $request = new Request();
     $request->setView("AdminPasswordChange");
     $request->setAction("PasswordChange");
     $form_action = $request->getURL();
     $template_contents = array("HiddenArrayViewState" => $this->outputViewState(), "FORM" => $HtmlForm1->genForm($form_action, "POST", ""), "Email" => $HtmlForm1->genHiddenField("AdminEmail", $this->POST["AdminEmail"]), "FirstName" => prepareHTMLDisplay($admin_info["firstname"]), "LastName" => prepareHTMLDisplay($admin_info["lastname"]), "SendByEmail" => $this->POST["SendByEmail"] ? " CHECKED" : "", "Errors" => $this->outputErrors(), "PSWUPD_002" => $obj->getMessage(new ActionMessage("PSWUPD_002")), "PSWUPD_004" => $obj->getMessage(new ActionMessage("PSWUPD_004")), "PSWUPD_005" => $obj->getMessage(new ActionMessage("PSWUPD_005")), "PSWUPD_007" => $obj->getMessage(new ActionMessage("PSWUPD_007")), "PSWUPD_008" => $obj->getMessage(new ActionMessage("PSWUPD_008")));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return modApiFunc('TmplFiller', 'fill', "users/admin_member_info/", "admin_member_passwd_reset.tpl.html", array());
 }
 /**
  *                     ViewState
  */
 function outputViewStateConstants()
 {
     //$retval = Catalog_AddPromoCode::outputViewStateConstants();
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $retval = "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("asc_action", "UpdatePromoCodeInfo") . ">";
     $retval .= "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("PromoCodeID", $this->POST["PromoCodeID"]) . ">";
     return $retval;
 }
Exemplo n.º 14
0
 /**
  * Returns the "Catalog -> Add Category" view html code.
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $this->MessageResources =& $application->getInstance('MessageResources');
     if ($this->ViewState["hasCloseScript"] == "true") {
         $this->outputFinalScript();
         return;
     }
     $template_contents_l1 = array("CatImageControls" => $this->outputCatImageControls($this->ViewState));
     $template_contents = array();
     $template_contents = array("Local_CategoryBookmarks" => getCategoryBookmarks('details', $this->_cat_id, $this->_bms_page_stat), "Subtitle" => $this->outputSubtitle(), "Errors" => $this->outputErrors(), "SubcategoriesError" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_001']) ? $this->ErrorMessages['ERR_AZ_CAT_ADDCAT_001'] : "", "MetaKeywordsError" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_003']) ? $this->ErrorMessages['ERR_AZ_CAT_ADDCAT_003'] : "", "MetaDescriptionError" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_004']) ? $this->ErrorMessages['ERR_AZ_CAT_ADDCAT_004'] : "", "SubcategoriesInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_001']) ? "error" : "", "MetaKeywordsInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_003']) ? "error" : "", "MetaDescriptionInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_CAT_ADDCAT_004']) ? "error" : "", "AddCatForm" => $HtmlForm1->genForm(modApiFunc("application", "getPagenameByViewname", "NavigationBar", -1, -1, 'AdminZone'), "POST", "AddCatForm"), "HiddenFormSubmitValue" => $HtmlForm1->genHiddenField("FormSubmitValue", "UploadImagesAndSave"), "HiddenArrayViewStateConstants" => $this->outputViewStateConstants(), "HiddenArrayViewState" => $this->outputViewState(), "SubcategoryId" => $this->outputCategoryId(), "Subcategory" => $HtmlForm1->genInputTextField("255", "Subcategory", "75", prepareHTMLDisplay($this->POST["SubcategoryText"])), "CategoryStatus" => $this->outputCategoryStatus(), "CategoryShowProductsRecursivelyStatus" => $this->outputCategoryShowProductsRecursivelyStatus(), "CategoryDescription" => $HtmlForm1->genInputTextAreaField("77", "CategoryDescription", "10"), "DescriptionText" => prepareHTMLDisplay($this->POST["DescriptionText"]), "ImageControls" => $template_contents_l1["CatImageControls"], "PageTitle" => $HtmlForm1->genInputTextField("256", "PageTitle", "76", prepareHTMLDisplay($this->POST["PageTitleText"])), "MetaKeywords" => $HtmlForm1->genInputTextAreaField("75", "MetaKeywords", "5"), "MetaKeywordsText" => prepareHTMLDisplay($this->POST["MetaKeywordsText"]), "MetaDescription" => $HtmlForm1->genInputTextAreaField("75", "MetaDescription", "5"), "MetaDescriptionText" => prepareHTMLDisplay($this->POST["MetaDescriptionText"]), "SEO_URL_prefix" => $HtmlForm1->genInputTextField("256", "SEO_URL_prefix", "76", prepareHTMLDisplay($this->POST["SEO_URL_prefix"])), "SubmitSaveScript" => $HtmlForm1->genSubmitScript("AddCatForm"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->MessageResources =& $application->getInstance('MessageResources');
     //: correct error codes
     $output = modApiFunc('TmplFiller', 'fill', './../../js/', 'validate.msgs.js.tpl', array("STRING1024" => $this->MessageResources->getMessage(new ActionMessage(array('CATADD_001'))), "STRING128" => $this->MessageResources->getMessage(new ActionMessage(array('CATADD_002'))), "STRING256" => $this->MessageResources->getMessage(new ActionMessage(array('CATADD_003'))), "STRING512" => $this->MessageResources->getMessage(new ActionMessage(array('CATADD_004')))));
     return $output . $this->mTmplFiller->fill("catalog/add_cat/", "list.tpl.html", array());
 }
 /**
  * Outputs the field for the given params
  */
 function outputField($field_type, $def_value = '', $max_select_count = 0)
 {
     $return_value = '';
     switch ($field_type) {
         case 'action':
             $return_value = '<input type="hidden" ' . HtmlForm::genHiddenField('asc_action', 'update_review_data') . ' />';
             break;
         case 'mode':
             $return_value = '<input type="hidden" ' . HtmlForm::genHiddenField('mode', 'update') . ' />';
             break;
         case 'cr_id':
             $return_value = '<input type="hidden" ' . HtmlForm::genHiddenField('review_data[cr_id]', @$this->_Review_Data['cr_id']) . ' />';
             break;
         case 'ip_address':
             $return_value = '<input type="hidden" ' . HtmlForm::genHiddenField('review_data[ip_address]', isset($this->_Review_Data['ip_address']) ? $this->_Review_Data['ip_address'] : $_SERVER['REMOTE_ADDR']) . ' />';
             break;
         case 'author':
             $return_value = '<input class="form-control input-sm input-large" type="text"' . HtmlForm::genInputTextField('128', 'review_data[author]', '70', prepareHTMLDisplay(@$this->_Review_Data['author'])) . ' />';
             break;
         case 'review':
             $return_value = '<textarea class="form-control input-large" name="review_data[review]" cols="53" rows="8">' . prepareHTMLDisplay(@$this->_Review_Data['review']) . '</textarea>';
             break;
         case 'status':
             $values = array();
             $values[] = array('value' => 'A', 'contents' => getMsg('CR', 'CR_STATUS_APPROVED'));
             if (@$this->_Review_Data['status'] == 'P') {
                 $values[] = array('value' => 'P', 'contents' => getMsg('CR', 'CR_STATUS_PENDING'));
             }
             $values[] = array('value' => 'N', 'contents' => getMsg('CR', 'CR_STATUS_NOTAPPROVED'));
             $return_value = HtmlForm::genDropdownSingleChoice(array('select_name' => 'review_data[status]', 'selected_value' => @$this->_Review_Data['status'], 'onChange' => '', 'id' => 'review_data[status]', 'class' => 'form-control input-sm input-small', 'values' => $values));
             break;
         case 'hour':
         case 'minute':
         case 'second':
             $values = array();
             for ($i = 0; $i < $max_select_count; $i++) {
                 $values[] = array('value' => sprintf("%02d", $i), 'contents' => sprintf("%02d", $i));
             }
             $return_value = HtmlForm::genDropdownSingleChoice(array('select_name' => 'review_data[' . $field_type . ']', 'selected_value' => $def_value, 'id' => 'review_data[' . $field_type . ']', 'values' => $values));
             break;
     }
     return $return_value;
 }
 /**
  *                     ViewState
  */
 function outputViewStateConstants()
 {
     //$retval = Catalog_AddManufacturer::outputViewStateConstants();
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $retval = "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("asc_action", "update_manufacturer") . ">";
     $retval .= "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("ManufacturerID", $this->POST["ManufacturerID"]) . ">";
     return $retval;
 }
 /**
  * .
  *
  * @ finish the functions on this page
  */
 function output()
 {
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "closeChild_UpdateParent");
         return;
     }
     global $application;
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     $variantId = $_GET['VariantId'];
     $this->_Template_Contents = array('HiddenArrayViewState' => $this->outputViewState(), 'HiddenFieldAction' => $HtmlForm->genHiddenField('asc_action', 'SaveSortedAttributes'), 'OptionsList' => $this->outputOptionsList($variantId), 'OptionsListHidden' => $this->getOptionsListHiddenArray($variantId), 'SaveAttrHref' => $this->outputSaveSortHref(), 'Sort_Object_CP' => $this->outputSortObject('CP'), 'Sort_Object_CS' => $this->outputSortObject('CS'), 'Sort_Object_P' => $this->outputSortObject('P'), 'Sort_Object_S' => $this->outputSortObject('S'), 'Sort_Subject' => $this->outputSortSubject(), 'PageHeader' => $this->MessageResources->getMessage("PAGE_HEADER"), 'PageName' => $this->MessageResources->getMessage("PAGE_NAME_SORT_ATTRIBUTES"), 'GroupName' => trim(modApiFunc("Checkout", "getVariantNameById", $variantId)), 'VariantId' => $variantId);
     $application->registerAttributes($this->_Template_Contents);
     $retval = modApiFunc('TmplFiller', 'fill', "checkout/checkout-info/", "sort-group.tpl.html", array());
     return $retval;
 }
 function out_Attributes()
 {
     global $application;
     $html_code = '';
     $yes_no_select = array('name' => '', 'value' => '', 'onChange' => '', 'id' => '', 'is_checked' => '');
     foreach ($this->reg_form_attrs as $attr_info) {
         switch ($attr_info['attr_name']) {
             case 'AccountName':
                 $this->login_attr_id = $attr_info['attr_id'];
                 break;
             case 'Email':
                 $this->email_attr_id = $attr_info['attr_id'];
                 break;
             case 'Country':
                 $this->country_attr_id = $attr_info['attr_id'];
                 break;
             case 'State':
                 $this->state_attr_id = $attr_info['attr_id'];
                 break;
         }
         if (in_array($attr_info['attr_name'], $this->hidden_props)) {
             continue;
         }
         foreach (array('is_visible', 'is_required') as $prop_name) {
             if (in_array($attr_info['attr_name'], $this->not_change_props)) {
                 $param = 'disabled';
             } else {
                 $param = '';
             }
             $var_name = $prop_name . '_checkbox';
             ${$var_name} = $yes_no_select;
             ${$var_name}['name'] = $attr_info['attr_name'] . '[' . $prop_name . ']';
             ${$var_name}['value'] = "Y";
             ${$var_name}['onChange'] = 'onChange_' . $prop_name . '(' . $attr_info['attr_id'] . ');';
             ${$var_name}['is_checked'] = $attr_info[$prop_name] == "Y" ? "checked" : "";
             ${$var_name}['id'] = $attr_info['attr_id'] . '_' . $prop_name;
             ${$var_name} = HtmlForm::genCheckbox(${$var_name}, $param);
             if ($param == 'disabled') {
                 ${$var_name} .= "\n <input type='hidden' " . HtmlForm::genHiddenField($attr_info['attr_name'] . '[disabled]', "disabled") . " />";
             }
         }
         $template_contents = array('Name' => prepareHTMLDisplay($attr_info['visible_name']), 'AttrID' => $attr_info['attr_id'], 'AttrName' => $attr_info['attr_name'], 'Descr' => getMsg('CA', $attr_info['lang_code']), 'IsVisible' => $is_visible_checkbox, 'IsRequiered' => $is_required_checkbox);
         $this->_Template_Contents = $template_contents;
         $application->registerAttributes($this->_Template_Contents);
         $this->mTmplFiller =& $application->getInstance('TmplFiller');
         $html_code .= $this->mTmplFiller->fill("customer_account/register_form_editor/", "attribute.tpl.html", array());
     }
     return $html_code;
 }
 /**
  * @abstract Prepares the list of custom attributes for each group
  * @param $variantId group id
  */
 function getCustomAttributesList($variantId)
 {
     global $application;
     $ids = modApiFunc('Checkout', 'getPersonInfoAttributeIdList', $variantId, 'CUSTOM_ATTRIBUTES_ONLY');
     $value = "";
     if (count($ids) == 0) {
         $value = $this->TemplateFiller->fill("checkout/checkout-info/", "no-custom-attributes.tpl.html", array());
         return $value;
     }
     foreach ($ids as $attributeId) {
         $fields = modApiFunc('Checkout', 'getPersonInfoFieldsList', $variantId, $attributeId);
         $yes_no_tpl = array('name' => '', 'value' => '', 'id' => '', 'is_checked' => '', 'onclick' => '');
         $param = "";
         $name_textbox = "<input type='text' style='border:1px solid #B2C2DF; font-family:Verdana,Arial,sans-serif; font-size:11px; vertical-align:top;' " . HtmlForm::genInputTextField(40, $fields['attribute_id'] . '[name]', 40, $fields['name'], "onchange='javascript:OnCheckboxClick" . $variantId . "(id)'") . "/>";
         if ($this->_Group_Template_Contents["PersonInfoTypeStatus"] == "false") {
             $name_textbox = $fields['name'];
             $param = "disabled";
         }
         foreach (array('visible', 'required') as $prop_name) {
             $var_name = $prop_name . '_checkbox';
             ${$var_name} = $yes_no_tpl;
             ${$var_name}['name'] = $fields['attribute_id'] . '[' . $prop_name . ']';
             ${$var_name}['value'] = "1";
             ${$var_name}['is_checked'] = $fields[$prop_name] == "1" ? "checked" : "";
             ${$var_name}['id'] = $fields['attribute_id'] . '_' . $prop_name;
             ${$var_name}['onclick'] = 'OnCheckboxClick' . $variantId . "('" . ${$var_name}['id'] . "')";
             if (!empty($fields['unremovable'])) {
                 $param = "disabled";
             }
             ${$var_name} = HtmlForm::genCheckbox(${$var_name}, $param);
             ${$var_name} .= "\n<input type='hidden' " . HtmlForm::genHiddenField($fields['attribute_id'] . '[attr_id]', $attributeId) . " />";
             if (!empty($fields['unremovable'])) {
                 ${$var_name} .= "\n<input type='hidden' " . HtmlForm::genHiddenField($fields['attribute_id'] . '[unremovable]', "unremovable") . " />";
             }
         }
         //$fields['name'];
         $template_contents = array("VariantId" => $variantId, "AttributeId" => $attributeId, "Name" => $name_textbox, "Descr" => $fields['descr'], "IsVisible" => $visible_checkbox, "IsRequiered" => $required_checkbox);
         $this->_Template_Contents = array_merge($this->_Template_Contents, $template_contents);
         $application->registerAttributes($this->_Template_Contents);
         switch ($this->_Group_Template_Contents["PersonInfoTypeStatus"]) {
             case "false":
                 $value .= $this->TemplateFiller->fill("checkout/checkout-info/", "attribute_inactive.tpl.html", array());
                 break;
             case "true":
                 $value .= $this->TemplateFiller->fill("checkout/checkout-info/", "attribute.tpl.html", array());
                 break;
             default:
                 //error
                 break;
         }
     }
     return $value;
 }
 /**
  * Outputs form contents.
  */
 function output()
 {
     global $application;
     $obj =& $application->getInstance('MessageResources');
     $retval = '';
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $request = new Request();
     $request->setView("AdminPasswordUpdate");
     $request->setAction("PasswordUpdate");
     $form_action = $request->getURL();
     $this->_Template_Content = array("HiddenArrayViewState" => $this->outputViewState(), "FORM" => $HtmlForm1->genForm($form_action, "POST", ""), "Email" => $HtmlForm1->genInputTextField("255", "AdminEmail", "40", $this->POST["AdminEmail"]), "Password" => $HtmlForm1->genHiddenField("Password", $this->POST["Password"]), "Old_Password" => $HtmlForm1->genInputTextField("255", "Old_Password", "40", ""), "New_Password" => $HtmlForm1->genInputTextField("255", "New_Password", "40", ""), "Verify_New_Password" => $HtmlForm1->genInputTextField("255", "Verify_New_Password", "40", ""), "Errors" => $this->outputErrors(), "PSWUPD_000" => $obj->getMessage(new ActionMessage("PSWUPD_000")), "PSWUPD_001" => $obj->getMessage(new ActionMessage("PSWUPD_001")), "PSWUPD_002" => $obj->getMessage(new ActionMessage("PSWUPD_002")), "PSWUPD_003" => $obj->getMessage(new ActionMessage("PSWUPD_003")), "PSWUPD_004" => $obj->getMessage(new ActionMessage("PSWUPD_004")), "PSWUPD_005" => $obj->getMessage(new ActionMessage("PSWUPD_005")), "PSWUPD_006" => $obj->getMessage(new ActionMessage("PSWUPD_006")), "PSWUPD_007" => $obj->getMessage(new ActionMessage("PSWUPD_007")));
     $application->registerAttributes($this->_Template_Content);
     $retval = modApiFunc('TmplFiller', 'fill', "users/", "password_update.tpl.html", array());
     return $retval;
 }
 /**
  * Outputs the result of searching
  */
 function outputSearchResults()
 {
     global $application;
     $template_contents = array('SearchTotal' => $this->outputSearchTotal(), 'TopButtons' => $this->outputTopButtons(), 'ResultForm' => $this->outputResultForm(), 'BottomButtons' => $this->outputBottomButtons(), 'ResActionField' => '<input type="hidden" ' . HtmlForm::genHiddenField('asc_action', 'update_customer_reviews') . ' />', 'ResModeField' => '<input type="hidden" ' . HtmlForm::genHiddenField('mode', 'update') . ' />', 'AddLinkID' => @$this->_search_filter['product']['id'] ? '&product_id=' . $this->_search_filter['product']['id'] : '');
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('customer_reviews/manage_customer_reviews/', 'search-results.tpl.html', array());
 }
 /**
  * Outputs the hidden fields ViewState.
  */
 function outputViewStateConstants()
 {
     //$retval = Catalog_AddCategory::outputViewStateConstants();
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $retval = "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("ParentCategoryID", $this->POST["ParentCategoryID"]) . ">" . "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("tree_id", modApiFunc('Request', 'getValueByKey', 'tree_id')) . ">" . "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("asc_action", "UpdateCategoryInfo") . ">";
     $retval .= "<input type=\"hidden\"" . $HtmlForm1->genHiddenField("CategoryID", $this->POST["CategoryID"]) . ">";
     return $retval;
 }
 /**
  * Return the "Manufacturers -> Add Manufacturer" view html code.
  *
  */
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->Hints =& $application->getInstance('Hint');
     $HtmlForm1 = new HtmlForm();
     $this->MessageResources =& $application->getInstance('MessageResources', "manufacturers-messages", "AdminZone");
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "closeChild_UpdateParent");
         return;
     }
     $manufacturer_summary = $this->outputManufacturerSummary();
     $this->_Template_Contents = array("ManufacturerSummary" => $manufacturer_summary);
     $application->registerAttributes($this->_Template_Contents);
     $template_contents = array("Subtitle" => $this->outputSubtitle(), "Errors" => $this->outputErrors(), "ManufacturerId" => $this->outputManufacturerId(), "ManufacturerSummary" => $manufacturer_summary, "ManufacturerNameError" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_001']) ? $this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_001'] : "", "ManufacturerNameInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_001']) ? "error" : "", "ManufacturerName" => $HtmlForm1->genInputTextField("128", "ManufacturerName", "75", prepareHTMLDisplay($this->POST["ManufacturerNameText"])), "ManufacturerIdFieldHint" => $this->Hints->getHintLink(array('MANUFACTURER_ID_NAME', 'manufacturers-messages')), "ManufacturerNameFieldHint" => $this->Hints->getHintLink(array('MNF_NAME_NAME', 'manufacturers-messages')), "ManufacturerImage" => getimage_input_az('mnf_image', $this->POST["ManufacturerImage"]), "ManufacturerImageFieldHint" => $this->Hints->getHintLink(array('MNF_IMAGE_NAME', 'manufacturers-messages')), "ManufacturerUrlError" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_004']) ? $this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_004'] : "", "ManufacturerUrlInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_004']) ? "error" : "", "ManufacturerUrl" => $HtmlForm1->genInputTextField("128", "ManufacturerUrl", "75", prepareHTMLDisplay($this->POST["ManufacturerUrlText"] === NULL ? '' : $this->POST["ManufacturerUrlText"])), "ManufacturerUrlFieldHint" => $this->Hints->getHintLink(array('MNF_URL_NAME', 'manufacturers-messages')), "ManufacturerDescError" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_002']) ? $this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_002'] : "", "ManufacturerDescInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_002']) ? "error" : "", "ManufacturerDesc" => $HtmlForm1->genInputTextAreaField("77", "ManufacturerDesc", "10"), "ManufacturerDescText" => prepareHTMLDisplay($this->POST["ManufacturerDescText"]), "ManufacturerDescFieldHint" => $this->Hints->getHintLink(array('MNF_DESC_NAME', 'manufacturers-messages')), "ManufacturerStatusError" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_003']) ? $this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_003'] : "", "ManufacturerStatusInputStyleClass" => isset($this->ErrorMessages['ERR_AZ_MNF_ADD_MNF_003']) ? "error" : "", "ManufacturerStatus" => $this->outputStatus(), "ManufacturerStatusFieldHint" => $this->Hints->getHintLink(array('MNF_STATUS_NAME', 'manufacturers-messages')), "AddManufacturerForm" => $HtmlForm1->genForm(modApiFunc("application", "getPagenameByViewname", "ManufacturersList", -1, -1, 'AdminZone'), "POST", "AddManufacturer"), "HiddenFormSubmitValue" => $HtmlForm1->genHiddenField("FormSubmitValue", "Save"), "HiddenArrayViewStateConstants" => $this->outputViewStateConstants(), "HiddenArrayViewState" => $this->outputViewState(), "SubmitSaveScript" => $HtmlForm1->genSubmitScript("AddManufacturerForm"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $SpecMessageResources =& $application->getInstance('MessageResources');
     //: correct error codes
     return $output = $this->mTmplFiller->fill("manufacturers/add_manufacturer/", "list.tpl.html", array());
 }
 /**
  * @ describe the function ProductList->getTag.
  */
 function getTag($tag)
 {
     global $application;
     $value = "";
     loadCoreFile('html_form.php');
     $HtmlForm = new HtmlForm();
     switch ($tag) {
         case 'HiddenArrayViewState':
             $value = $this->outputViewState();
             break;
         case 'Items':
             $value = $this->outputListItems();
             break;
         case 'HiddenFieldAction':
             $value = $HtmlForm->genHiddenField('asc_action', $this->outputAction());
             break;
         case 'DeleteProdTypeHref':
             $value = $this->outputDeleteHref();
             break;
         case 'Delete_Subject':
             $value = $this->outputDeleteSubject();
             break;
         case 'ProductTypeI':
             $value = $this->_Current_ProductType['ProductTypeI'];
             break;
         case 'ProductTypeID':
             $value = $this->_Current_ProductType['id'];
             break;
         case 'ProductTypeEnabled':
             $value = $this->_Current_ProductType['ProductTypeEnabled'];
             break;
         case 'ProductTypeName':
             $value = $this->_Current_ProductType['name'];
             break;
         case 'ProductTypeWarning':
             $value = $this->_Current_ProductType['ProductTypeWarning'];
             break;
         case 'ProductTypeInfoLink':
             $value = $this->_Current_Product['ProductInfoLink'];
             break;
     }
     return $value;
 }
 /**
  * Outputs the result of searching
  */
 function outputSearchResults()
 {
     global $application;
     $template_contents = array('CurLang' => $this->_search_filter['lng'], 'SearchTotal' => $this->outputSearchTotal(), 'TopButtons' => $this->outputTopButtons(), 'ResultForm' => $this->outputResultForm(), 'BottomButtons' => $this->outputBottomButtons(), 'ResActionField' => '<input type="hidden" ' . HtmlForm::genHiddenField('asc_action', 'ML_UpdateLabels') . ' />', 'ResModeField' => '<input type="hidden" ' . HtmlForm::genHiddenField('mode', 'update') . ' />', 'LngField' => '<input type="hidden" ' . HtmlForm::genHiddenField('lng', $this->_search_filter['lng']) . ' />');
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('multilang/label_editor/', 'search-results.tpl.html', array());
 }
 function output()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->Hints =& $application->getInstance('Hint');
     $HtmlForm1 = new HtmlForm();
     $this->MessageResources =& $application->getInstance('MessageResources', "shipping-cost-calculator-messages", "AdminZone");
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "UpdateParentsParent");
         //            modApiFunc("application", "UpdateParent");
     }
     $pbrowser_params = array('show_category_path' => true, 'buttons' => array('add_cat' => array('label' => 'BTN_ADDCAT', 'style_class' => 'button button_8em', 'callback' => 'addCategoryToCatList(%CID%,%CNAME%);', 'default_state' => 'disabled', 'enable_condition' => 'category_selected'), 'add_prod' => array('label' => 'BTN_ADDPRD', 'style_class' => 'button button_8em', 'callback' => 'addProductToRPList(%PID%,%PNAME%);', 'default_state' => 'disabled', 'enable_condition' => 'product_selected')), 'choosed_control_array' => 'product_array');
     loadClass('ProductsBrowser');
     $this->pb_obj = new ProductsBrowser();
     $request = new Request();
     $request->setView('EditFsRuleArea');
     $request->setAction('UpdateFsRuleArea');
     $template_contents = array("Subtitle" => $this->outputSubtitle(), "Errors" => $this->outputErrors(), "Local_ProductsBrowser" => $this->pb_obj->output($pbrowser_params), 'jsProductArray' => $this->out_jsProductArray(), 'jsCatArray' => $this->out_jsCatArray(), 'ProductList' => $this->out_ProductList(), 'CategoriesList' => $this->out_CategoriesList(), 'RPFormAction' => $request->getURL(), 'jsControlPListFunc' => str_replace(array('%PID%'), array('product_id'), $this->pb_obj->getControlPListFunction()), "AddFsRuleForm" => $request->getURL(), "HiddenFormSubmitValue" => $HtmlForm1->genHiddenField("FormSubmitValue", "SaveArea"), "HiddenArrayViewStateConstants" => $this->outputViewStateConstants(), "HiddenArrayViewState" => $this->outputViewState(), "SubmitSaveScript" => $HtmlForm1->genSubmitScript("AddFsRuleForm"));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill("shipping_cost_calculator/edit_fs_rule_area/", "list.tpl.html", array());
 }