Title магазина и ИС как в HostCMS v.5

Модератор
#
Title магазина и ИС как в HostCMS v.5
Для информационных систем:


<?php

$oInformationsystem = Core_Entity::factory('Informationsystem', Core_Array::get(Core_Page::instance()->libParams, 'informationsystemId'));

$Informationsystem_Controller_Show = new Informationsystem_Controller_Show($oInformationsystem);

$Informationsystem_Controller_Show
   ->limit(Core_Array::get(Core_Page::instance()->libParams, 'itemsOnPage'))
   ->parseUrl();

// Текстовая информация для указания номера страницы, например "страница"
$pageName = Core_Array::get(Core_Page::instance()->libParams, 'page')
   ? Core_Array::get(Core_Page::instance()->libParams, 'page')
   : 'страница';

// Разделитель в заголовке страницы
$pageSeparator = Core_Array::get(Core_Page::instance()->libParams, 'separator')
   ? Core_Page::instance()->libParams['separator']
   : ' / ';

if ($Informationsystem_Controller_Show->group)
{
   $oInformationsystem_Group = Core_Entity::factory('Informationsystem_Group', $Informationsystem_Controller_Show->group);

   Core_Page::instance()->title($oInformationsystem_Group->seo_title != ''
         ? $oInformationsystem_Group->seo_title
         : $oInformationsystem_Group->name);
   Core_Page::instance()->description($oInformationsystem_Group->seo_description != ''
         ? $oInformationsystem_Group->seo_description
         : $oInformationsystem_Group->name);
   Core_Page::instance()->keywords($oInformationsystem_Group->seo_keywords != ''
         ? $oInformationsystem_Group->seo_keywords
         : $oInformationsystem_Group->name);
}

if ($Informationsystem_Controller_Show->item)
{
   $oInformationsystem_Item = Core_Entity::factory('Informationsystem_Item', $Informationsystem_Controller_Show->item);

   Core_Page::instance()->title($oInformationsystem_Item->seo_title != ''
         ? $oInformationsystem_Item->seo_title
         : $oInformationsystem_Item->name);
   Core_Page::instance()->description($oInformationsystem_Item->seo_description != ''
         ? $oInformationsystem_Item->seo_description
         : $oInformationsystem_Item->name);
   Core_Page::instance()->keywords($oInformationsystem_Item->seo_keywords != ''
         ? $oInformationsystem_Item->seo_keywords
         : $oInformationsystem_Item->name);
}

Core_Page::instance()->object = $Informationsystem_Controller_Show;
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
Модератор
#
Re: Title магазина и ИС как в HostCMS v.5
Для магазина:


<?php

$oShop = Core_Entity::factory('Shop', Core_Array::get(Core_Page::instance()->libParams, 'shopId'));

$Shop_Controller_Show = new Shop_Controller_Show($oShop);

$Shop_Controller_Show
   ->limit($oShop->items_on_page)
   ->parseUrl();

// Обработка скачивания файла электронного товара
$guid = Core_Array::getGet('download_file');
if (strlen($guid))
{
   $oShop_Order_Item_Digital = Core_Entity::factory('Shop_Order_Item_Digital')->getByGuid($guid);

   if (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)
   {
      $iDay = 7;

      // Проверяем, доступна ли ссылка (Ссылка доступна в течение суток после оплаты)
      if (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)
      {
         $oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;
         if ($oShop_Item_Digital->filename != '')
         {
            Core_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);
            exit();
         }
      }
      else
      {
         Core_Message::show(Core::_('Shop_Order_Item_Digital.time_is_up', $iDay));
      }
   }

   Core_Page::instance()->response->status(404)->sendHeaders()->showBody();
   exit();
}

// Сравнение товаров
if (Core_Array::getRequest('compare'))
{
   $shop_item_id = intval(Core_Array::getRequest('compare'));
   
   if (Core_Entity::factory('Shop_Item', $shop_item_id)->shop_id == $oShop->id)
   {
      Core_Session::start();
      if (isset($_SESSION['hostcmsCompare'][$oShop->id][$shop_item_id]))
      {
         unset($_SESSION['hostcmsCompare'][$oShop->id][$shop_item_id]);
      }
      else
      {
         $_SESSION['hostcmsCompare'][$oShop->id][$shop_item_id] = 1;
      }
   }
   exit();
}

// Текстовая информация для указания номера страницы, например "страница"
$pageName = Core_Array::get(Core_Page::instance()->libParams, 'page')
   ? Core_Array::get(Core_Page::instance()->libParams, 'page')
   : 'страница';

// Разделитель в заголовке страницы
$pageSeparator = Core_Array::get(Core_Page::instance()->libParams, 'separator')
   ? Core_Page::instance()->libParams['separator']
   : ' / ';

if ($Shop_Controller_Show->group)
{
   $oShop_Group = Core_Entity::factory('Shop_Group', $Shop_Controller_Show->group);

   Core_Page::instance()->title($oShop_Group->seo_title != ''
         ? $oShop_Group->seo_title
         : $oShop_Group->name);
   Core_Page::instance()->description($oShop_Group->seo_description != ''
         ? $oShop_Group->seo_description
         : $oShop_Group->name);
   Core_Page::instance()->keywords($oShop_Group->seo_keywords != ''
         ? $oShop_Group->seo_keywords
         : $oShop_Group->name);
}

if ($Shop_Controller_Show->item)
{
   $oShop_Item = Core_Entity::factory('Shop_Item', $Shop_Controller_Show->item);

   Core_Page::instance()->title($oShop_Item->seo_title != ''
         ? $oShop_Item->seo_title
         : $oShop_Item->name);
   Core_Page::instance()->description($oShop_Item->seo_description != ''
         ? $oShop_Item->seo_description
         : $oShop_Item->name);
   Core_Page::instance()->keywords($oShop_Item->seo_keywords != ''
         ? $oShop_Item->seo_keywords
         : $oShop_Item->name);
}

Core_Page::instance()->object = $Shop_Controller_Show;
Вы только что начали читать предложение, чтение которого вы уже заканчиваете.
#
Re: Title магазина и ИС как в HostCMS v.5
у страниц меток при данном варианте исчезает титл, остается общим для всех меток, как-то можно поправить?
Авторизация