protected function findObjectType($queryVars)
{
// Setup Object type for page
$view = array_key_exists('view', $queryVars) ? $queryVars['view'] : '';
// To determine if we are viewing normal entry layout or preview layout
$layout = array_key_exists('layout', $queryVars) ? $queryVars['layout'] : '';
$object = null;
if ($view == 'entry')
{
$this->loadEB();
$blog = $this->getEBTable('Blog');
$objectTypes = $this->getObjects('post');
$blogId = $queryVars['id'];
// If layout is preview, we need to get the proper blog id.
// For preview layout, the id will be uid.
if ($layout && $layout == 'preview') {
$blogId = $queryVars['uid'];
}
// Alternately, we can use EB::post($blogId) to load the post.
// The system will inteligently enough to determine this post is preview or normal post based on the provided id/uid.
$post = EB::post($blogId);
if ($post) {
$catId = $post->category_id;
$object = $this->getBestCategory($objectTypes, $catId);
}
// if ($blog->load($blogId))
// {
// $catId = $blog->category_id;
// $object = $this->getBestCategory($objectTypes, $catId);
// }
}
return $object;
}
$blogId = $queryVars['id'];
// If layout is preview, we need to get the proper blog id.
// For preview layout, the id will be uid.
if ($layout && $layout == 'preview') {
$blogId = $queryVars['uid'];
}
// If layout is preview, we need to get the proper blog id.
// For preview layout, the id will be uid.
if ($layout && $layout == 'preview') {
$blogId = $queryVars['uid'];
}
else
$blogId = $queryVars['id'];
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.