function output() { global $application; $request = new Request(); $this->category_id = $request->getValueByKey('category_id'); $this->tree_id = $request->getValueByKey('tree_id'); //$cat_obj = &$application->getInstance('CCategoryInfo',$this->category_id); $this->BSLinks = modApiFunc('Bestsellers_API', 'getHardBSLinksForCategory', $this->category_id); $this->sets = modApiFunc('Bestsellers_API', 'getSettings', $this->category_id); $pbrowser_params = array('show_category_path' => true, 'buttons' => array('add' => array('label' => 'BTN_ADD', 'callback' => 'addProductToBSList(%PID%,%PNAME%);', 'default_state' => 'disabled', 'enable_condition' => 'product_selected')), 'choosed_control_array' => 'bestsellers_array'); $request->setView('PopupWindow'); // $request->setView('BS_LinksList'); $request->setAction('save_bs_links_and_settings'); $request->setKey('category_id', $this->category_id); $request->setKey('tree_id', $this->tree_id); loadClass('ProductsBrowser'); $this->pb_obj = new ProductsBrowser(); $template_contents = array('ReloadCategoryReview' => $this->out_ReloadCategoryReview(), 'Breadcrumb' => $this->out_Breadcrumb(), 'Local_CategoryBookmarks' => getCategoryBookmarks('bestsellers', $this->category_id), 'ResultMessage' => $this->outputResultMessage(), 'Local_ProductsBrowser' => $this->pb_obj->output($pbrowser_params), 'jsBestsellersArray' => $this->out_jsBestsellersArray(), 'BestsellersList' => $this->out_BestsellersList(), 'BSFormAction' => $request->getURL(), 'BSSortForm' => $this->out_BSSortForm(), 'jsControlPListFunc' => str_replace(array('%PID%'), array('product_id'), $this->pb_obj->getControlPListFunction()), 'SettingsForm' => $this->out_SettingsForm()); $this->_Template_Contents = $template_contents; $application->registerAttributes($this->_Template_Contents); $this->mTmplFiller =& $application->getInstance('TmplFiller'); return $this->mTmplFiller->fill("bestsellers/bs_links_list/", "container.tpl.html", array()); }
/** * 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()); }