/** * Возвращает html код с хлебными крошками * * @return string */ private static function getBreadcrumbs() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $breadcrumbs = array(); $manufacturerId = (int) $_GET['man']; $manufacturers = $tecDocRestClient->getManufacturers(); if (is_array($manufacturers)) { foreach ($manufacturers as $oneManufacturer) { if ($oneManufacturer->id === $manufacturerId) { $breadcrumbs[] = array('name' => $oneManufacturer->name, 'url' => "?man={$manufacturerId}"); } } } $models = $tecDocRestClient->getModels($manufacturerId); $modelId = (int) $_GET['model']; if (is_array($models)) { foreach ($models as $oneModel) { if ($oneModel->id === $modelId) { $breadcrumbs[] = array('name' => $oneModel->name); } } } $templateData = array('breadcrumbs' => $breadcrumbs); return View::deploy('common/breadcumbs.tpl', $templateData); }
/** * Возвращает html код с хлебными крошками * * @return string */ private static function getBreadcrumbs() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $modificationId = (int) $_GET['modelVariant']; $modification = $tecDocRestClient->getModificationById($modificationId); $breadcrumbs = array(array('name' => $modification->manufacturerName, 'url' => "?man={$modification->manufacturerId}"), array('name' => $modification->modelName, 'url' => "?man={$modification->manufacturerId}&model={$modification->modelId}"), array('name' => $modification->name)); $templateData = array('breadcrumbs' => $breadcrumbs); return View::deploy('common/breadcumbs.tpl', $templateData); }
/** * Возвращает html страницы с модификациями * * @return string */ public function getHtml() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $modelId = $_GET['modelVariant']; $modification = $tecDocRestClient->getModificationById($modelId); $contentTemplateData = array('modification' => $modification); $content = View::deploy('full.info.model.variant.tpl', $contentTemplateData); $templateData = array('content' => $content); return View::deploy('index.tpl', $templateData); }
/** * Возвращает html страницы с приминимостями * * @return string */ public function getHtml() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $articleId = $_GET['articleId']; $adaptability = $tecDocRestClient->getAdaptability($articleId); $contentTemplateData = array('adaptability' => $adaptability); $content = View::deploy('adaptability.tpl', $contentTemplateData); $templateData = array('content' => $content); return View::deploy('index.tpl', $templateData); }
/** * Возвращает html страницы с аналогами * * @return string */ public function getHtml() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $number = $_GET['number']; $analogs = $tecDocRestClient->getAnalogs($number, AnalogTypes::ANY); $contentTemplateData = array('analogs' => $analogs); $content = View::deploy('analogs.tpl', $contentTemplateData); $templateData = array('content' => $content); return View::deploy('index.tpl', $templateData); }
/** * Возвращает html код с хлебными крошками * * @return string */ private static function getBreadcrumbs() { $tecDocRestClient = new TecDoc(); $tecDocRestClient->setUserKey(TecDocApiConfig::USER_KEY)->setUserLogin(TecDocApiConfig::USER_LOGIN)->setUserPsw(TecDocApiConfig::USER_PSW); $modificationId = (int) $_GET['modelVariant']; $selectedGroupId = (int) $_GET['group']; $modification = $tecDocRestClient->getModificationById($modificationId); $modelVariants = $tecDocRestClient->getModelVariant($modificationId); $modelVariant = new ModelVariant(); if (is_array($modelVariants)) { foreach ($modelVariants as $oneModelVariant) { if ($oneModelVariant->id === $selectedGroupId) { $modelVariant = $oneModelVariant; break; } } } $breadcrumbs = array(array('name' => $modification->manufacturerName, 'url' => "?man={$modification->manufacturerId}"), array('name' => $modification->modelName, 'url' => "?man={$modification->manufacturerId}&model={$modification->modelId}"), array('name' => $modification->name, 'url' => "?man={$modification->manufacturerId}&model={$modification->modelId}&modelVariant={$modification->id}"), array('name' => $modelVariant->name)); $templateData = array('breadcrumbs' => $breadcrumbs); return View::deploy('common/breadcumbs.tpl', $templateData); }
/** * Возвращает html код с хлебными крошками * * @return string */ private static function getBreadcrumbs() { $templateData = array('breadcrumbs' => array()); return View::deploy('common/breadcumbs.tpl', $templateData); }