<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @package Beverages
* @subpackage Blocks
* @since 1.0
* @author trabis <lusopoemas@gmail.com>
* @author The SmartFactory <www.smartfactory.ca>
*/
// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
include_once dirname(__DIR__) . '/include/common.php';
/**
* @param $options
*
* @return array
*/
function beverages_items_random_item_show($options)
{
$block = array();
$beverages = BeveragesBeverages::getInstance();
// creating the ITEM object
$itemsObj = $beverages->getHandler('item')->getRandomItem('', array(BeveragesConstants::BEVERAGES_STATUS_PUBLISHED));
if (!is_object($itemsObj)) {
return $block;
}
$block['content'] = $itemsObj->getBlockSummary(300, true); //show complete summary but truncate to 300 if only body available
$block['id'] = $itemsObj->itemid();
$block['url'] = $itemsObj->getItemUrl();
$block['title'] = $itemsObj->title(); // irmtfan
$block['lang_fullitem'] = _MB_BEVERAGES_FULLITEM;
return $block;
}