function outputAcceptedCurrenciesRule($options_values, $selected_value)
 {
     $options = array();
     foreach ($options_values as $rule) {
         $options[] = array("value" => $rule['rule_name'], "contents" => getMsg('SYS', $rule['rule_name']));
     }
     loadCoreFile('html_form.php');
     $HtmlForm1 = new HtmlForm();
     $value = $HtmlForm1->genDropdownSingleChoice(array("onChange" => "try{accepted_currencies_rule_onchange();} catch(ex) {};", "select_name" => "pm_sm_accepted_currencies_rule", "class" => "input-large", "values" => $options, "selected_value" => $selected_value, "id" => "pm_sm_accepted_currencies_rule"));
     return $value;
 }
 function output()
 {
     global $application;
     $settings = modApiFunc('Quick_Books', 'getSettings');
     $op_as_inv_select = array("select_name" => "qbs[OP_AS_INV]", "selected_value" => $settings['OP_AS_INV'], 'class' => 'form-control input-sm input-xsmall', "values" => array(array('value' => 'Y', 'contents' => getMsg('QB', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('QB', 'LBL_NO'))));
     $template_contents = array("TrnsClassField" => HtmlForm::genInputTextField('255', 'qbs[TRNS_CLASS]', '70', $settings['TRNS_CLASS']), "AccTaxField" => HtmlForm::genInputTextField('255', 'qbs[ACC_TAX]', '70', $settings['ACC_TAX']), "AccProductField" => HtmlForm::genInputTextField('255', 'qbs[ACC_PRODUCT]', '70', $settings['ACC_PRODUCT']), "AccShippingField" => HtmlForm::genInputTextField('255', 'qbs[ACC_SHIPPING]', '70', $settings['ACC_SHIPPING']), "AccInventoryField" => HtmlForm::genInputTextField('255', 'qbs[ACC_INVENTORY]', '70', $settings['ACC_INVENTORY']), "AccGlobalDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_GLOBAL_DISCOUNT]', '70', $settings['ACC_GLOBAL_DISCOUNT']), "AccPromoCodeDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_PROMOCODE_DISCOUNT]', '70', $settings['ACC_PROMOCODE_DISCOUNT']), "AccQuantityDiscountField" => HtmlForm::genInputTextField('255', 'qbs[ACC_QUANTITY_DISCOUNT]', '70', $settings['ACC_QUANTITY_DISCOUNT']), "OpAsInvField" => HtmlForm::genDropdownSingleChoice($op_as_inv_select), "MinQISField" => HtmlForm::genInputTextField('255', 'qbs[MIN_QIS]', '70', $settings['MIN_QIS']), "AccCOGSField" => HtmlForm::genInputTextField('255', 'qbs[ACC_COGS]', '70', $settings['ACC_COGS']), "OrdersPrefixField" => HtmlForm::genInputTextField('255', 'qbs[QB_ORDERS_PREFIX]', '70', $settings['QB_ORDERS_PREFIX']), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("quick_books/settings/", "container.tpl.html", array());
 }
 function output()
 {
     global $application;
     $cats_select = array('select_name' => 'ProductCategory', 'id' => 'ProductCategory', 'selected_value' => 1, 'values' => array());
     $cats = modApiFunc("Catalog", "getSubcategoriesFullListWithParent", 1, false);
     foreach ($cats as $cat) {
         $cats_select['values'][] = array('value' => $cat['id'], 'contents' => str_repeat('  ', $cat['level']) . $cat['name']);
     }
     $template_contents = array('ProductListSubcategories' => HtmlForm::genDropdownSingleChoice($cats_select, ' style="width: 290px; font-family: courier new; font-size: 11px;"'), 'CategoriesPaths' => $this->outputCategoriesPaths($cats));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("catalog/export_products/", "container-2.tpl.html", array());
 }
Пример #4
0
 function output()
 {
     global $application;
     $settings = modApiFunc('Manufacturers', 'getSettings');
     $ag_select = array("select_name" => "pi_sets[AUTO_GEN_MAIN_SMALL_IMAGE]", "selected_value" => $settings['AUTO_GEN_MAIN_SMALL_IMAGE'], "values" => array(array('value' => 'Y', 'contents' => getMsg('MNF', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('MNF', 'LBL_NO'))));
     $ag_param = '';
     if (!function_exists('gd_info')) {
         $ag_select["selected_value"] = "N";
         $ag_param = 'disabled';
     }
     $template_contents = array('TSField' => HtmlForm::genInputTextField('25', 'pi_sets[THUMB_SIDE]', '5', $settings['THUMB_SIDE']), 'TPLField' => HtmlForm::genInputTextField('25', 'pi_sets[THUMBS_PER_LINE]', '5', $settings['THUMBS_PER_LINE']), 'AGField' => HtmlForm::genDropdownSingleChoice($ag_select, $ag_param), 'MISField' => HtmlForm::genInputTextField('25', 'pi_sets[MAIN_IMAGE_SIDE]', '5', $settings['MAIN_IMAGE_SIDE'], $ag_param), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("manufacturers/settings/", "container.tpl.html", array());
 }
 /**
  * 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;
 }
 function output()
 {
     global $application;
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey("page_view", "TaxRateByZip_AddNewSet");
     $request->setAction('TaxRatesRedirectToImportAction');
     $formAction = $request->getURL();
     $title = getMsg('TAX_ZIP', 'ADD_NEW_SET_PAGE_TITLE');
     $descr_value = '';
     $updateSid = $request->getValueByKey("updateSid", 0);
     if ($updateSid) {
         $set_to_update = modApiFunc("TaxRateByZip", "getSet", $updateSid);
         if (isset($set_to_update[0]["name"])) {
             $descr_value = $set_to_update[0]["name"];
             $title = getMsg('TAX_ZIP', 'UPDATE_SET_PAGE_TITLE');
             $title = str_replace("%1%", $descr_value, $title);
             $request->setKey("updateSid", $updateSid);
             $formAction = $request->getURL();
         }
     }
     $ptypes_select = array('select_name' => 'TargetPType', 'id' => 'TargetPType', 'selected_value' => '0', 'values' => array());
     $ptypes = modApiFunc('Catalog', 'getProductTypes');
     foreach ($ptypes as $ptype) {
         $ptypes_select['values'][] = array('value' => $ptype['id'], 'contents' => $ptype['name']);
     }
     $cats_select = array('select_name' => 'TargetCategory', 'id' => 'TargetCategory', 'selected_value' => 1, 'values' => array());
     $cats = modApiFunc("Catalog", "getSubcategoriesFullListWithParent", 1, false);
     foreach ($cats as $cat) {
         $cats_select['values'][] = array('value' => $cat['id'], 'contents' => str_repeat('&nbsp;&nbsp;', $cat['level']) . $cat['name']);
     }
     $template_contents = array("FormAction" => $formAction, "DescriptionValue" => $descr_value, "Title" => $title, "Errors" => $this->outputResultMessage(), 'PTypesList' => HtmlForm::genDropdownSingleChoice($ptypes_select, ' style="width: 290px;"'), 'CategoriesList' => HtmlForm::genDropdownSingleChoice($cats_select, ' style="width: 290px;"'));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill("", "container.tpl.html", array());
 }
Пример #7
0
 function output()
 {
     global $application;
     $settings = modApiFunc('Product_Images', 'getSettings');
     $detailedFullImageResizeSelect = array("select_name" => "pi_sets[RESIZE_DETAILED_LARGE_IMAGE]", "selected_value" => $settings['RESIZE_DETAILED_LARGE_IMAGE'], "values" => array(array('value' => 'Y', 'contents' => getMsg('PI', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('PI', 'LBL_NO'))));
     $fullImageResizeSelect = array("select_name" => "pi_sets[RESIZE_LARGE_IMAGE]", "selected_value" => $settings['RESIZE_LARGE_IMAGE'], "values" => array(array('value' => 'Y', 'contents' => getMsg('PI', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('PI', 'LBL_NO'))));
     $ag_select = array("select_name" => "pi_sets[AUTO_GEN_MAIN_SMALL_IMAGE]", "selected_value" => $settings['AUTO_GEN_MAIN_SMALL_IMAGE'], "values" => array(array('value' => 'Y', 'contents' => getMsg('PI', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('PI', 'LBL_NO'))));
     $ag_param = '';
     if (!function_exists('gd_info')) {
         $ag_select["selected_value"] = "N";
         $ag_param = 'disabled';
     }
     $cat_ag_select = array("select_name" => "pi_sets[AUTO_GEN_CAT_SMALL_IMAGE]", "selected_value" => $settings['AUTO_GEN_CAT_SMALL_IMAGE'], "values" => array(array('value' => 'Y', 'contents' => getMsg('PI', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('PI', 'LBL_NO'))));
     $cat_ag_param = '';
     if (!function_exists('gd_info')) {
         $cat_ag_select["selected_value"] = "N";
         $cat_ag_param = 'disabled';
     }
     $template_contents = array('TSField' => HtmlForm::genInputTextField('25', 'pi_sets[THUMB_SIDE]', '5', $settings['THUMB_SIDE']), 'TPLField' => HtmlForm::genInputTextField('25', 'pi_sets[THUMBS_PER_LINE]', '5', $settings['THUMBS_PER_LINE']), 'TPLSetting' => $application->getAppIni('PRODUCT_LIST_DISABLE_TR_TD'), 'AGField' => HtmlForm::genDropdownSingleChoice($ag_select, $ag_param), 'CatAGField' => HtmlForm::genDropdownSingleChoice($cat_ag_select, $cat_ag_param), 'fullImageResizeField' => HtmlForm::genDropdownSingleChoice($fullImageResizeSelect, $ag_param), 'detailedFullImageResizeField' => HtmlForm::genDropdownSingleChoice($detailedFullImageResizeSelect, $ag_param), 'MISField' => HtmlForm::genInputTextField('25', 'pi_sets[MAIN_IMAGE_SIDE]', '5', $settings['MAIN_IMAGE_SIDE'], $ag_param), 'CatMISField' => HtmlForm::genInputTextField('25', 'pi_sets[CAT_IMAGE_SIDE]', '5', $settings['CAT_IMAGE_SIDE'], $cat_ag_param), 'firField' => HtmlForm::genInputTextField('25', 'pi_sets[LARGE_IMAGE_SIZE]', '5', $settings['LARGE_IMAGE_SIZE'], $ag_param), 'dfirField' => HtmlForm::genInputTextField('25', 'pi_sets[DETAILED_LARGE_IMAGE_SIZE]', '5', $settings['DETAILED_LARGE_IMAGE_SIZE'], $ag_param), "ResultMessage" => $this->outputResultMessage());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("product_images/settings/", "container.tpl.html", array());
 }
 /**
  * Outputs the status select box for the given record
  */
 function outputStatusValue($record)
 {
     $values = array();
     $values[] = array('value' => 'A', 'contents' => getMsg('CR', 'CR_STATUS_APPROVED'));
     if ($record['status'] == 'P') {
         $values[] = array('value' => 'P', 'contents' => getMsg('CR', 'CR_STATUS_PENDING'));
     }
     $values[] = array('value' => 'N', 'contents' => getMsg('CR', 'CR_STATUS_NOTAPPROVED'));
     return HtmlForm::genDropdownSingleChoice(array('select_name' => 'data[' . $record['cr_id'] . '][status]', 'selected_value' => $record['status'], 'onChange' => 'javascript: onStatusChanged(' . $record['cr_id'] . ')', 'id' => 'data[' . $record['cr_id'] . '][status]', 'class' => 'form-control input-small', 'values' => $values));
 }
Пример #9
0
 function outStatesSelect()
 {
     if (isset($this->POST["DstCountry"])) {
         $states = modApiFunc("Location", "getStates", $this->POST["DstCountry"]);
     }
     $states_select = array("select_name" => "DstState_menu_select", "id" => "DstState_menu_select", "values" => array());
     if (isset($this->POST["DstState_menu_select"])) {
         $states_select["selected_value"] = $this->POST["DstState_menu_select"];
     }
     if (isset($states) and !empty($states)) {
         foreach ($states as $sid => $sname) {
             $states_select["values"][] = array("value" => $sid, "contents" => $sname);
         }
     }
     $state_name = !empty($this->POST["DstState_text_div"]) ? $this->POST["DstState"] : "";
     $html_ss = HtmlForm::genDropdownSingleChoice($states_select);
     $html_div = "<div id=\"DstState_test_div\"><input class='form-control input-sm input-large' type=\"text\" id=\"DstState_text_div\" " . HtmlForm::genInputTextField("125", "DstState_text_div", "55", $state_name) . "></div>";
     return $html_ss . $html_div;
 }
 function outputExtensionTypeFilterSelect()
 {
     $result = execQuery('SELECT_ALL_MARKETPLACE_EXTENSION_DETAILS');
     $values[] = array('value' => getMsg('SYS', 'CUSTOMERS_SEARCH_ALL'), 'contents' => getMsg('SYS', 'CUSTOMERS_SEARCH_ALL'));
     # For displaying All extensions
     if (!empty($result)) {
         foreach ($result as $content) {
             $ext_cat = $content['extension_category'];
             $ext_cat_display = ucwords(str_replace('_', ' ', $content['extension_category']));
             $values[] = array('value' => "{$ext_cat}", 'contents' => "{$ext_cat_display}");
         }
     }
     $filter_select = array('select_name' => 'category_filter_by', 'selected_value' => $this->search_filter['category_filter_by'], 'class' => 'form-contrl input-sm input-small inline', 'onChange' => "window.location = 'configure-extensions.php?category_filter_by='+this.value;", 'values' => array_unique($values, SORT_REGULAR));
     return HtmlForm::genDropdownSingleChoice($filter_select);
 }
 function outputSettingsForm()
 {
     $return_html_code = "";
     global $application;
     $options_settings = modApiFunc("Product_Options", "getOptionsSettingsForEntity", $this->parent_entity, $this->entity_id);
     if (count($this->Options) > 0) {
         $aawd_select = array("select_name" => "os[AAWD]", "class" => "from-control input-sm input-xsmall", "selected_value" => $options_settings['AAWD'], "values" => array(array("value" => "Y", "contents" => $this->MessageResources->getMessage('LBL_YES')), array("value" => "N", "contents" => $this->MessageResources->getMessage('LBL_NO'))));
         $aanic_select = array("select_name" => "os[AANIC]", "class" => "from-control input-sm input-xsmall", "selected_value" => $options_settings['AANIC'], "values" => array(array("value" => "Y", "contents" => $this->MessageResources->getMessage('LBL_YES')), array("value" => "N", "contents" => $this->MessageResources->getMessage('LBL_NO'))));
         $aanis_select = array("select_name" => "os[AANIS]", "class" => "from-control input-sm input-xsmall", "selected_value" => $options_settings['AANIS'], "values" => array(array("value" => "Y", "contents" => $this->MessageResources->getMessage('LBL_YES')), array("value" => "N", "contents" => $this->MessageResources->getMessage('LBL_NO'))));
         $template_contents = array("_parent_entity" => $this->parent_entity, "_entity_id" => $this->entity_id, "inv_sets_display" => count($this->__for_it_opts) > 0 ? '' : 'none', "setAAWDfield" => HtmlForm::genDropdownSingleChoice($aawd_select), "setAANICfield" => HtmlForm::genDropdownSingleChoice($aanic_select), "WRN_ONS_text" => $options_settings["WRN_ONS"], "WRN_CI_CR_text" => $options_settings["WRN_CI_CR"], "WRN_CI_INV_text" => $options_settings["WRN_CI_INV"], "HintLink_AAWD" => $this->Hints->getHintLink(array('SETTING_AAWD', 'product-options-messages')), "HintLink_ANIC" => $this->Hints->getHintLink(array('SETTING_AANIC', 'product-options-messages')), "HintLink_WRN_ONS" => $this->Hints->getHintLink(array('SETTING_WRN_ONS', 'product-options-messages')), "HintLink_WRN_CI_CR" => $this->Hints->getHintLink(array('SETTING_WRN_CI_CR', 'product-options-messages')), "HintLink_WRN_CI_INV" => $this->Hints->getHintLink(array('SETTING_WRN_CI_INV', 'product-options-messages')), "LL_NTF_value" => $options_settings['LL_NTF'], "setAANISfield" => HtmlForm::genDropdownSingleChoice($aanis_select));
         $this->_Template_Contents = $template_contents;
         $application->registerAttributes($this->_Template_Contents);
         $this->mTmplFiller =& $application->getInstance('TmplFiller');
         $return_html_code .= $this->mTmplFiller->fill("product_options/settings-form/", "container.tpl.html", array());
     }
     return $return_html_code;
 }
Пример #12
0
 function output()
 {
     global $application;
     $mr_info = modApiFunc('Mod_Rewrite', 'detectModRewrite');
     $rw_schemes = modApiFunc('Mod_Rewrite', 'getRewriteSchemes');
     // <begin>                                      mod_rewrite
     $tests_results = array();
     //                     "     "
     echo "<!-- Tests results:\n";
     for ($i = 1; $i <= 2; $i++) {
         $tests_results[$i] = $this->_makeTest($i, "Ok");
         if ($tests_results[$i]) {
             echo "{$i}: Ok\n";
         } else {
             echo "{$i}: Error\n";
         }
     }
     echo " -->";
     if (!in_array(true, $tests_results)) {
         $mr_info['tests_status'] = false;
     } else {
         //                                    ,
         //        Options +FollowSymLinks   .htaccess
         $mr_info['tests_status'] = true;
         $_sets = array('ADD_FSL_STRING' => array_search(true, $tests_results) == 2 ? 'Y' : 'N');
         modApiFunc('Mod_Rewrite', 'updateSettings', $_sets);
     }
     // <end>                                      mod_rewrite
     $schemes_select = array("id" => "sets[REWRITE_SCHEME]", "select_name" => "sets[REWRITE_SCHEME]", "selected_value" => $this->mr_settings['REWRITE_SCHEME'], "onChange" => "changeSampleLinks(this.value);", "values" => array());
     foreach ($rw_schemes as $k => $scheme_info) {
         $schemes_select['values'][] = array("value" => $scheme_info['scheme_id'], "contents" => getMsg('MR', 'RS_' . _ml_strtoupper($scheme_info['scheme_name'])));
     }
     $template_contents = array('ResultMessage' => $this->outputResultMessage(), 'ServerSoft' => $mr_info['server_soft'], 'MRloaded' => $mr_info['mod_rewrite_loaded'], 'setsCatsPrefix' => HtmlForm::genInputTextField('255', 'sets[CATS_PREFIX]', '50', $this->mr_settings['CATS_PREFIX']), 'setsProdsPrefix' => HtmlForm::genInputTextField('255', 'sets[PRODS_PREFIX]', '50', $this->mr_settings['PRODS_PREFIX']), 'setsCMSPrefix' => HtmlForm::genInputTextField('255', 'sets[CMS_PREFIX]', '50', $this->mr_settings['CMS_PREFIX']), 'MRStatusMessage' => $this->outMRStatusMessage($mr_info), 'setsSchemesSelect' => HtmlForm::genDropdownSingleChoice($schemes_select), 'jsLinkSmaplesArray' => $this->out_jsLinkSmaplesArray(), 'currentSchemeID' => $this->mr_settings['REWRITE_SCHEME'], 'LayoutsSettings' => $this->_form_disabled ? '' : $this->out_LayoutsSettings(), 'disableAllCondition' => $this->_form_disabled ? 'true' : 'false');
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("mod_rewrite/", "container.tpl.html", array());
 }
 function outputStatus()
 {
     $selected_index = $this->POST["ManufacturerStatusValue"];
     $options = array(array("value" => DB_TRUE, "contents" => getMsg('MNF', "MNF_STATUS_ACTIVE")), array("value" => DB_FALSE, "contents" => getMsg('MNF', "MNF_STATUS_INACTIVE")));
     $HtmlForm1 = new HtmlForm();
     $value = $HtmlForm1->genDropdownSingleChoice(array("onChange" => "", "select_name" => "ManufacturerStatus", "values" => $options, "selected_value" => $selected_index));
     return $value;
 }
Пример #14
0
 function getThemeSwitcher()
 {
     $switcher = '';
     $themes = modApiStaticFunc('Look_Feel', 'getThemeList');
     if ($themes) {
         $values = array(array('value' => '', 'contents' => getXMsg('LF', 'LF_THEME_DEFAULT')));
         foreach ($themes as $theme) {
             $values[] = array('value' => $theme['name'], 'contents' => $theme['name']);
         }
         $switcher = HtmlForm::genDropdownSingleChoice(array('select_name' => 'active_theme', 'class' => 'input-medium', 'selected_value' => modApiFunc('Look_Feel', 'getActiveTheme'), 'values' => $values, 'onChange' => 'setActiveTheme(this)'));
     }
     return $switcher;
 }
 function out_SearchLetterFilterSelect()
 {
     $filter_select = array('select_name' => 'letter_filter_by', 'selected_value' => $this->search_filter['letter_filter_by'], 'class' => 'form-control input-sm input-small inline', 'onChange' => "window.location = 'customers.php?letter_filter_by='+this.value;", 'values' => array(array('value' => 'account_name', 'contents' => getMsg('CA', 'LBL_FILTER_BY_ACCOUNT')), array('value' => 'customer_name', 'contents' => getMsg('CA', 'LBL_FILTER_BY_LASTNAME'))));
     return HtmlForm::genDropdownSingleChoice($filter_select);
 }
 /**
  * Output the attribute data
  */
 function outputAttr($prod_id, $attr, $index, $v_index)
 {
     if (!$attr['visible']) {
         return getMsg('CTL', 'CTL_PGE_NA');
     }
     $output = '';
     // setting the style and value depending on the error
     $style = '';
     $value = @$attr['value'];
     if (isset($this->_Errors[$prod_id]) && isset($this->_Errors[$prod_id][$attr['view_tag']])) {
         $style = ' style="border: 1px solid; border-color: red;"';
         if (isset($this->_Posted_Data[$prod_id][$attr['view_tag']])) {
             $value = $this->_Posted_Data[$prod_id][$attr['view_tag']];
         }
     }
     // tabbing
     $tabbing = $this->_tabbing == 'RIGHT' ? count($this->_attrs) * $index + $v_index : count($this->_Prod_IDs) * $v_index + $index;
     $tabbing = ' tabindex="' . $tabbing . '"';
     switch ($attr['input_type_name']) {
         case 'read-only':
             $output = prepareHTMLDisplay($value);
             break;
         case 'select':
             $values = array();
             foreach ($attr['input_type_values'] as $k => $v) {
                 $values[] = array('value' => $k, 'contents' => $v);
             }
             $output = HtmlForm::genDropdownSingleChoice(array('onChange' => '', 'class' => 'input-sm', 'select_name' => 'posted_data[' . $prod_id . '][' . $attr['view_tag'] . ']', 'values' => $values, 'selected_value' => $value), $style . $tabbing);
             break;
         case 'text':
             $size = 40;
             if ($attr['size'] < 50) {
                 $size = 8;
             }
             if ($attr['size'] < 20) {
                 $size = 5;
             }
             $output = '<input class="form-control input-sm" type="text"' . HtmlForm::genInputTextField($attr['max'], 'posted_data[' . $prod_id . '][' . $attr['view_tag'] . ']', $size, $value) . $style . $tabbing . ' />';
             break;
         default:
             $output = getMsg('CTL', 'CTL_PGE_NA');
     }
     return $output;
 }
Пример #17
0
 function getTopicStatusSelect($select_name, $selected_status = null)
 {
     $statuses = Subscriptions::getTopicStatusesNames();
     $options = array();
     foreach ($statuses as $status => $status_name) {
         $options[] = array('value' => $status, 'contents' => $status_name);
     }
     return HtmlForm::genDropdownSingleChoice(array('select_name' => $select_name, 'values' => $options, 'selected_value' => $selected_status));
 }
 function output()
 {
     global $application;
     $otype_select = array("select_name" => "Option[OptionType]", "selected_value" => $this->DATA["Option"]["OptionType"], "id" => "Option_OptionType", "onChange" => "javascript: onOptionTypeChanged();", "values" => array());
     $template_contents = array();
     foreach ($this->_option_types as $otype => $show_types) {
         $otype_select["values"][] = array("value" => $otype, "contents" => $this->MessageResources->getMessage('OT_' . $otype));
         $tmp = array("select_name" => "Option[ShowType][{$otype}]", "selected_value" => $this->DATA["Option"]["ShowType"][$otype], "id" => "Option_ShowType_{$otype}", "onChange" => $otype == "CI" ? "javascript: onShowTypeChanged();" : "", "values" => array());
         foreach ($show_types as $shtype) {
             $tmp["values"][] = array("value" => $shtype, "contents" => $this->MessageResources->getMessage('ST_' . $otype . '_' . $shtype));
         }
         $template_contents["ShowType" . $otype . "Field"] = HtmlForm::genDropdownSingleChoice($tmp, 'style="width: 200px;"');
     }
     $yes_no_values = array();
     foreach (array('YES', 'NO') as $lbl) {
         $yes_no_values[] = array("value" => $lbl, "contents" => $this->MessageResources->getMessage('LBL_' . $lbl));
     }
     $discard_avail_select = array("select_name" => "Option[DiscardAvail]", "selected_value" => $this->DATA["Option"]["DiscardAvail"], "onChange" => "javascript: onDiscardAvailChanged();", "id" => "Option_DiscardAvail", "values" => $yes_no_values);
     $use_for_it_select = array("select_name" => "Option[UseForIT]", "selected_value" => $this->DATA["Option"]["UseForIT"], "id" => "Option_UseForIT", "values" => $yes_no_values);
     $request = new Request();
     $request->setView('PO_OptionsList');
     $request->setKey("parent_entity", $this->option_info["parent_entity"]);
     $request->setKey("entity_id", $this->option_info["entity_id"]);
     $template_contents = array_merge($template_contents, array("ActualHeader" => $this->outputActualHeader(), "ResultMessage" => $this->outputResultMessage(), "_option_id" => $this->option_id, "_parent_entity" => $this->option_info["parent_entity"], "_entity_id" => $this->option_info["entity_id"], "OptionNameField" => HtmlForm::genInputTextField('255', 'Option[OptionName]', '65', prepareHTMLDisplay($this->DATA["Option"]["OptionName"])), "DisplayNameField" => HtmlForm::genInputTextField('255', 'Option[DisplayName]', '65', prepareHTMLDisplay($this->DATA["Option"]["DisplayName"])), "OptionDescription" => HtmlForm::genInputTextAreaField("77", "Option[DisplayDescr]", "5"), "DescriptionText" => $this->DATA["Option"]["DisplayDescr"], "OptionTypeField" => HtmlForm::genDropdownSingleChoice($otype_select, 'style="width: 200px;"'), "JS_OnOptionTypeChanged" => $this->output__JS_OnOptionTypeChanged($this->_option_types, "show_type_for_"), "DiscardAvailField" => HtmlForm::genDropdownSingleChoice($discard_avail_select, 'style="width: 200px;"'), "DiscardValueField" => HtmlForm::genInputTextField('255', 'Option[DiscardValue]', '65', prepareHTMLDisplay(@$this->DATA["Option"]["DiscardValue"]), 'id=Option_DiscardValue'), "JS_OnDiscardAvailChanged" => $this->output__JS_OnDiscardAvailChanged('Option_DiscardAvail', 'Option_DiscardValue'), "CheckBoxTextField" => HtmlForm::genInputTextField('255', 'Option[CheckBoxText]', '65', prepareHTMLDisplay($this->DATA["Option"]["CheckBoxText"]), 'id=Option_CheckBoxText'), "UseForITField" => HtmlForm::genDropdownSingleChoice($use_for_it_select, 'style="width: 200px;"'), "JS_OnShowTypeChanged" => $this->output__JS_OnShowTypeChanged(array('CBSI', 'CBTA'), 'Option_CheckBoxText'), "EditValuesForm" => $this->outputEditValuesForm(), "AddNewValueForm" => $this->outputAddNewValueForm(), "CancelLink" => $request->getURL(), "ValuesSortForm" => $this->outputValuesSortForm(), "JSchangeToCIwarning" => $this->outputJSchangeToCIwarning(), "JSchangeINVwarning" => $this->outputJSchangeINVwarning(), "HintLink_OpName" => $this->Hints->getHintLink(array('OPTION_NAME', 'product-options-messages')), "HintLink_DspName" => $this->Hints->getHintLink(array('DISPLAY_NAME', 'product-options-messages')), "HintLink_DspDescr" => $this->Hints->getHintLink(array('DISPLAY_DESCR', 'product-options-messages')), "HintLink_OpType" => $this->Hints->getHintLink(array('OPTION_TYPE', 'product-options-messages')), "HintLink_ShType" => $this->Hints->getHintLink(array('SHOW_TYPE', 'product-options-messages')), "HintLink_DisAvail" => $this->Hints->getHintLink(array('DISCARD_AVAIL', 'product-options-messages')), "HintLink_DisValue" => $this->Hints->getHintLink(array('DISCARD_VALUE', 'product-options-messages')), "HintLink_CBText" => $this->Hints->getHintLink(array('CHECKBOX_TEXT', 'product-options-messages')), "HintLink_UseForIT" => $this->Hints->getHintLink(array('USE_FOR_IT', 'product-options-messages')), "JSforIE6" => $this->outputJSforIE6()));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("product_options/", "edit-option-container.tpl.html", array());
 }
 function out_AccountActivationSchemeSelect()
 {
     $_select = array('select_name' => 'sets[ACCOUNT_ACTIVATION_SCHEME]', 'selected_value' => $this->settings['ACCOUNT_ACTIVATION_SCHEME'], 'id' => 'ActivationScheme', 'onChange' => 'setActivationSchemeField(); changeHint(\'activation_scheme\',this.value);', 'values' => array(array('value' => ACCOUNT_ACTIVATION_SCHEME_NONE, 'contents' => getMsg('CA', 'ACCOUNT_ACTIVATION_SCHEME_NONE')), array('value' => ACCOUNT_ACTIVATION_SCHEME_BY_ADMIN, 'contents' => getMsg('CA', 'ACCOUNT_ACTIVATION_SCHEME_BY_ADMIN')), array('value' => ACCOUNT_ACTIVATION_SCHEME_BY_CUSTOMER, 'contents' => getMsg('CA', 'ACCOUNT_ACTIVATION_SCHEME_BY_CUSTOMER'))));
     return HtmlForm::genDropdownSingleChoice($_select);
 }
 function output()
 {
     global $application;
     if ($this->ViewState["hasCloseScript"] == "true") {
         modApiFunc("application", "UpdateParent");
     }
     # Per order shipping fee types
     $po_sc_types = array("select_name" => "PO_SC_TYPE", "selected_value" => $this->POST["PO_SC_TYPE"], "values" => array(array("value" => "A", "contents" => modApiFunc("Localization", "getCurrencySign")), array("value" => "P", "contents" => "%")));
     $request = new Request();
     $request->setView('AddFsRule');
     $AddFsRuleHref = $request->getURL();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setAction("DeleteFsRule");
     $FsRuleDeleteActionUrl = $request->getURL();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setAction('update_scc_settings');
     $updateSccSettingsActionUrl = $request->getURL();
     $currentCountry = isset($this->POST["FS_COUNTRY_ASSUME"]) ? $this->POST["FS_COUNTRY_ASSUME"] : '';
     $currentCountry = $this->POST['FS_COUNTRY_HIDE'] == '1' ? $currentCountry : '-3';
     $currentState = isset($this->POST["FS_STATE_ASSUME"]) ? $this->POST["FS_STATE_ASSUME"] : '';
     $cOpts = modApiFunc("Checkout", "genCountrySelectList", $currentCountry, false, true);
     $sOpts = modApiFunc("Checkout", "genStateSelectList", $currentState, $currentCountry, true);
     $template_contents = array("HiddenArrayViewState" => $this->outputViewState(), "Errors" => $this->outputErrors(), "SSC_Header" => $this->MessageResources->getMessage("SSC_HEADER"), "LabelSettings" => $this->MessageResources->getMessage("LABEL_SETTINGS"), "POSC_FieldName" => $this->MessageResources->getMessage("PER_ORDER_SHIPPING_COST"), "POSC_FieldValue" => $this->POST["PO_SC"], "POSC_Type" => HtmlForm::genDropdownSingleChoice($po_sc_types), "POHC_FieldName" => $this->MessageResources->getMessage("PER_ORDER_HANDLING_COST"), "POHC_FieldValue" => $this->POST["PO_HC"], "MINSC_FieldName" => $this->MessageResources->getMessage("MINIMUM_SHIPPING_COST"), "MINSC_FieldValue" => $this->POST["MIN_SC"], "FSOO_FieldName" => $this->MessageResources->getMessage("FREE_SHIPPING"), "FSOO_FieldValue" => $this->POST["FS_OO"], "FHOO_FieldName" => $this->MessageResources->getMessage("FREE_HANDLING"), "FHOO_FieldValue" => $this->POST["FH_OO"], "JavascriptSynchronizeCountriesAndStatesLists" => modApiFunc("Location", "getJavascriptCountriesStatesArrays", true, array(), array(), true, true) . modApiFunc("Checkout", "getJavascriptSynchronizeCountriesAndStatesLists") . "<SCRIPT LANGUAGE=\"JavaScript\">" . "\n" . "<!--\n" . "\n" . "var onload_bak = window.onload;" . "\n" . "window.onload = function()" . "\n" . "{" . "\n" . "    if(onload_bak){onload_bak();}" . "\n" . "    refreshStatesList('DstCountry', 'DstState_menu_select', 'stub_state_text_input');" . "}" . "\n" . "//-->" . "\n" . "</SCRIPT>" . "\n", "CountriesOptions" => $cOpts, "StatesOptions" => $sOpts, "ZipValue" => $this->POST["FS_ZIP_ASSUME"], "CountryHideSelected" => $this->POST['FS_COUNTRY_HIDE'] == '1' ? 'selected' : '', "CountryDoNotHideSelected" => $this->POST['FS_COUNTRY_HIDE'] == '0' ? 'selected' : '', "StateHideSelected" => $this->POST['FS_STATE_HIDE'] == '1' ? 'selected' : '', "StateDoNotHideSelected" => $this->POST['FS_STATE_HIDE'] == '0' ? 'selected' : '', "ZipHideSelected" => $this->POST['FS_ZIP_HIDE'] == '1' ? 'selected' : '', "ZipDoNotHideSelected" => $this->POST['FS_ZIP_HIDE'] == '0' ? 'selected' : '', "TrCountryDisplay" => $this->POST['FS_COUNTRY_HIDE'] == '0' ? 'style="display: none"' : '', "TrStateDisplay" => $this->POST['FS_STATE_HIDE'] == '0' ? 'style="display: none"' : '', "TrZipDisplay" => $this->POST['FS_ZIP_HIDE'] == '0' ? 'style="display: none"' : '', 'FS_METHOD_LABEL_VALUE' => $this->POST['FS_METHOD_LABEL_VALUE'], 'FS_MODE_OPTIONS' => $this->outputFsModeOptions(), 'FS_PLACING_OPTIONS' => $this->outputFsPlacingOptions(), "Alert_001" => $this->MessageResources->getMessage("ALERT_001"), "Alert_002" => $this->MessageResources->getMessage("ALERT_002"), "Alert_003" => $this->MessageResources->getMessage("ALERT_003"), "Alert_004" => $this->MessageResources->getMessage("ALERT_004"), "Alert_005" => $this->MessageResources->getMessage("ALERT_005"), "CurrecySign" => modApiFunc("Localization", "getCurrencySign"), "CostFormat" => modApiFunc("Localization", "format_settings_for_js", "currency"), "SaveSelectedShippingSettingsHref" => $updateSccSettingsActionUrl);
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $mainMessageResources =& $application->getInstance('MessageResources');
     $output = modApiFunc('TmplFiller', 'fill', './../../js/', 'validate.msgs.js.tpl', array("INTEGER" => $mainMessageResources->getMessage(new ActionMessage(array('PRDADD_001'))), "FLOAT" => $mainMessageResources->getMessage(new ActionMessage(array('PRDADD_002'))), "STRING1024" => $mainMessageResources->getMessage(new ActionMessage(array('CATADD_001'))), "STRING128" => $mainMessageResources->getMessage(new ActionMessage(array('CATADD_002'))), "STRING256" => $mainMessageResources->getMessage(new ActionMessage(array('CATADD_003'))), "STRING512" => $mainMessageResources->getMessage(new ActionMessage(array('CATADD_004'))), "CURRENCY" => addslashes($mainMessageResources->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($mainMessageResources->getMessage(new ActionMessage(array('WEIGHT_FIELD', modApiFunc("Localization", "FloatToFormatStr", 23.325, "weight"), modApiFunc("Localization", "FloatToFormatStr", 34, "weight"), modApiFunc("Localization", "FloatToFormatStr", 99.2, "weight"))))), "ITEM" => $mainMessageResources->getMessage(new ActionMessage(array('ITEM_FIELD')))));
     return $output . $this->mTmplFiller->fill("shipping_cost_calculator/", "settings.tpl.html", array());
 }
 /**
  *
  */
 function output()
 {
     global $application;
     $request =& $application->getInstance('Request');
     $this->_froogleSettings = modApiFunc('Froogle', 'getSettings');
     $cats_select = array('select_name' => 'ProductCategory', 'id' => 'ProductCategory', 'class' => 'form-control input-sm input-small', 'selected_value' => 1, 'values' => array());
     $cats = modApiFunc("Catalog", "getSubcategoriesFullListWithParent", 1, false);
     foreach ($cats as $cat) {
         $cats_select['values'][] = array('value' => $cat['id'], 'contents' => str_repeat('&nbsp;&nbsp;', $cat['level']) . $cat['name']);
     }
     $template_contents = array('ExpirationDate' => $this->outputExpiresDate(), 'Location' => $this->_froogleSettings['LOCATION'], 'PaymentNotes' => $this->_froogleSettings['PAYMENT_NOTES'], 'PaymentAcceptedList' => $this->outputPaymentAcceptedList(), 'ProductListSubcategories' => HtmlForm::genDropdownSingleChoice($cats_select), 'StorefrontLinks' => $this->outputStorefrontLinks(), 'DateSelector' => $this->outputDateDropDowns());
     $this->_templateContents = $template_contents;
     $application->registerAttributes($this->_templateContents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("froogle/export/", "container.tpl.html", array());
 }
Пример #22
0
 function getParamHTMLControl($group_name, $param_name)
 {
     loadCoreFile('html_form.php');
     $param_info = $this->getParamBaseInfo($group_name, $param_name);
     $control_value = $param_info['PARAM_CURRENT_VALUE'];
     $control_name = SETTIGS_POST_MAP_NAME . '[' . $param_info['GROUP_NAME'] . '][' . $param_info['PARAM_NAME'] . ']';
     $html = '';
     switch ($param_info['PARAM_TYPE']) {
         case PARAM_TYPE_FLOAT:
         case PARAM_TYPE_INT:
         case PARAM_TYPE_STRING:
             $html = '<input class="form-control form-filter input-large" type="text" ' . HtmlForm::genInputTextField(250, $control_name, 50, $control_value) . ' />';
             break;
         case PARAM_TYPE_LIST:
             $param_values = modApiFunc('Settings', 'getParamValueList', $param_info['GROUP_NAME'], $param_info['PARAM_NAME'], SETTINGS_WITH_DESCRIPTION);
             $select_data = array('onChange' => '', 'select_name' => $control_name, 'selected_value' => $control_value, 'values' => array());
             foreach ($param_values as $value) {
                 $select_data['values'][] = array('value' => $value['VALUE'], 'contents' => $value['VALUE_DESCRIPTION']['NAME']);
             }
             $html = HtmlForm::genDropdownSingleChoice($select_data);
             break;
     }
     return $html;
 }
 /**
  * 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;
 }
 function out_SettingsForm()
 {
     global $application;
     $yes_no_array = array(array('value' => 'Y', 'contents' => getMsg('BS', 'LBL_YES')), array('value' => 'N', 'contents' => getMsg('BS', 'LBL_NO')));
     $set_afs_select = array('select_name' => 'sets[ADD_BS_FROM_STAT]', 'selected_value' => $this->sets['ADD_BS_FROM_STAT'], 'onChange' => 'setSettingsFormState();', 'values' => $yes_no_array);
     $multipliers = array(1, 7, 30, 365);
     $set_fsp_value = $this->sets['BS_FROM_STAT_PERIOD'];
     end($multipliers);
     do {
         $divider = 3600 * 24 * current($multipliers);
         prev($multipliers);
     } while ($set_fsp_value % $divider != 0);
     $set_fsp_value = $set_fsp_value / $divider;
     $set_fsp_select = array('select_name' => 'sets[BS_FROM_STAT_PERIOD][type]', 'selected_value' => $divider, 'values' => array(array('value' => 3600 * 24 * 1, 'contents' => getMsg('BS', 'LBL_DAY')), array('value' => 3600 * 24 * 7, 'contents' => getMsg('BS', 'LBL_WEEK')), array('value' => 3600 * 24 * 30, 'contents' => getMsg('BS', 'LBL_MONTH')), array('value' => 3600 * 24 * 365, 'contents' => getMsg('BS', 'LBL_YEAR'))));
     $set_sr_select = array('select_name' => 'sets[SHOW_RECURSIVELY]', 'selected_value' => $this->sets['SHOW_RECURSIVELY'], 'values' => $yes_no_array);
     $tags = array('setsAFSselect' => HtmlForm::genDropdownSingleChoice($set_afs_select), 'setsFSCvalue' => prepareHTMLDisplay($this->sets['BS_FROM_STAT_COUNT']), 'setsFSPvalue' => $set_fsp_value, 'setsFSPtype' => HtmlForm::genDropdownSingleChoice($set_fsp_select), 'setsSRselect' => HtmlForm::genDropdownSingleChoice($set_sr_select));
     $this->_Template_Contents = $tags;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("bestsellers/bs_links_list/", "settings_form.tpl.html", array());
 }
 /**
  * Outputs New_Language default select box
  */
 function outputNewDefaultStatus()
 {
     return HtmlForm::genDropdownSingleChoice(array("select_name" => 'new_lng[is_default]', "selected_value" => 'N', "onChange" => '', "values" => array(array('value' => 'Y', 'contents' => getMsg('ML', 'ML_YES')), array('value' => 'N', 'contents' => getMsg('ML', 'ML_NO')))));
 }
 function getGroupsDropDown($customer_id = null, $customer_group = null)
 {
     $values = array();
     foreach ($this->getGroups($customer_id) as $id => $name) {
         array_push($values, array('value' => $id, 'contents' => $name));
     }
     $dropdown = array('select_name' => 'membership[' . $customer_id . ']', 'selected_value' => $customer_group, 'values' => $values, 'class' => 'form-control form-filter input-small input-sm input-inline');
     return HtmlForm::genDropdownSingleChoice($dropdown);
 }
 function out_StatesSelect($selected_value)
 {
     $country = $this->customer_obj->getPersonInfo('Country', $this->current_group_name);
     if ($country == null or $country == '') {
         $country = modApiFunc('Location', 'getDefaultCountryId');
     }
     $states = modApiFunc('Location', 'getStates', $country);
     if ($selected_value == null || $selected_value == '') {
         $selected_value = modApiFunc('Location', 'getDefaultStateId', $country);
     }
     #else if (count($states) != 0)
     #    $selected_value = "";
     $states_select = array("select_name" => 'customer_info[' . $this->current_group_name . '][' . $this->current_attr_name . ']', "selected_value" => $selected_value, "id" => 'customer_info_' . $this->current_group_name . '_' . $this->current_attr_name, "values" => array());
     foreach ($states as $state_id => $state_name) {
         $states_select["values"][] = array("value" => $state_id, "contents" => $state_name);
     }
     $uid = uniqid('onload_');
     $js_syn = modApiFunc("Checkout", "getJavascriptSynchronizeCountriesAndStatesLists") . modApiFunc("Location", "getJavascriptCountriesStatesArrays") . "<script type=\"text/javascript\">" . "\n" . "<!--\n" . "\n" . "var " . $uid . "_bak = window.onload;" . "\n" . "window.onload = function()" . "\n" . "{" . "\n" . "    if(" . $uid . "_bak){" . $uid . "_bak();}" . "\n" . "refreshStatesList('" . 'customer_info_' . $this->current_group_name . '_Country' . "', '" . 'customer_info_' . $this->current_group_name . '_' . $this->current_attr_name . "', '" . 'customer_info_' . $this->current_group_name . '_' . $this->current_attr_name . '_div' . "');" . "}" . "\n" . "//-->" . "\n" . "</script>" . "\n";
     $html_select = HtmlForm::genDropdownSingleChoice($states_select);
     $html_input = "<div id=\"" . 'customer_info_' . $this->current_group_name . '_' . $this->current_attr_name . "_div\" style=\"display: none;\">" . "<input type=\"text\" id=\"" . 'customer_info_' . $this->current_group_name . '_' . $this->current_attr_name . "_text\" " . HtmlForm::genInputTextField("125", 'customer_info[' . $this->current_group_name . '][' . $this->current_attr_name . "_text]", "32", $selected_value ? prepareHTMLDisplay($selected_value) : '') . " /></div>";
     return $js_syn . $html_select . $html_input;
 }
 function out_SelectOrderPaymentStatus()
 {
     $select_array = array("select_name" => "order_payment_status", "values" => array(array("value" => ORDER_PAYMENT_STATUS_ALL, "contents" => 'Any')));
     $statuses = modApiFunc('Checkout', 'getOrderPaymentStatusList');
     foreach ($statuses as $k => $info) {
         $select_array["values"][] = array("value" => $info['id'], "contents" => $info['name']);
     }
     if (isset($this->incoming_filter['order_payment_status'])) {
         $select_array["selected_value"] = $this->incoming_filter['order_payment_status'];
     }
     return HtmlForm::genDropdownSingleChoice($select_array);
 }
 /**
  * Outputs label type select box
  */
 function outputTypeSelect()
 {
     $values = array(array('value' => 'all', 'contents' => getMsg('ML', 'ML_ALL_LABELS')), array('value' => 'storefront', 'contents' => getMsg('ML', 'ML_STOREFRONT_LABELS')), array('value' => 'storefront_cz', 'contents' => '&nbsp;&nbsp;' . getMsg('ML', 'ML_AVACTIS_LABELS')), array('value' => 'CZ_CUSTOM', 'contents' => '&nbsp;&nbsp;' . getMsg('ML', 'ML_CUSTOM_LABELS')), array('value' => 'admin', 'contents' => getMsg('ML', 'ML_ADMINZONE_LABELS')));
     if (is_array($this->_modules)) {
         foreach ($this->_modules as $m) {
             $values[] = array('value' => $m['shortname'], 'contents' => '&nbsp;&nbsp;' . $m['module']);
         }
     }
     return HtmlForm::genDropdownSingleChoice(array('select_name' => 'type', 'selected_value' => @$this->_search_filter['type'], 'id' => 'type', 'values' => $values));
 }
 function output()
 {
     global $application;
     $request =& $application->getInstance('Request');
     $this->parent_entity = $request->getValueByKey('parent_entity');
     $this->entity_id = $request->getValueByKey('entity_id');
     $this->Options = modApiFunc("Product_Options", "getOptionsWithValues", $this->parent_entity, $this->entity_id, NOT_CUSTOM_INPUT);
     for ($i = 0; $i < count($this->Options); $i++) {
         if ($this->Options[$i]['use_for_it'] != 'Y') {
             $this->not_used_for_inv_count++;
         }
     }
     $this->sets = modApiFunc("Product_Options", "getOptionsSettingsForEntity", $this->parent_entity, $this->entity_id);
     $req_to_ret = new Request();
     $req_to_ret->setView('PO_OptionsList');
     $req_to_ret->setKey('parent_entity', $this->parent_entity);
     $req_to_ret->setKey('entity_id', $this->entity_id);
     $aanic_select = array("select_name" => "os[AANIC]", "id" => "os_AANIC", "selected_value" => $this->sets["AANIC"], "values" => array(array("value" => "Y", "contents" => $this->MessageResources->getMessage('LBL_YES')), array("value" => "N", "contents" => $this->MessageResources->getMessage('LBL_NO'))));
     $template_contents = array("_parent_entity" => $this->parent_entity, "_entity_id" => $this->entity_id, "ActualHeader" => $this->outputActualHeader(), "ReturnToOLLink" => $req_to_ret->getURL(), "NRecordForm" => $this->outputNRecordForm(), "OptionsDiv" => $this->outputOptionsDiv(), "AANIC_select" => HtmlForm::genDropdownSingleChoice($aanic_select), "CurrentActiveSS" => "ss" . $this->sets['INV_PER_PAGE'], "InitSSide" => $this->outputInitSSide(), "jsDropDownDefinition" => $this->output_jsDropDownDefinition());
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("product_options/", "inv-editor-container.tpl.html", array());
 }