Ejemplo n.º 1
0
	/**
	 * Fetches the standard page view for a widget.
	 *
	 * @param bool $skip_errors					- If using a collection, omit widgets that throw errors
	 * @return vBCms_View_Widget				- The resolved view, or array of views
	 */
	public function getPageView()
	{
		$this->assertWidget();
		$config = $this->widget->getConfig();

		if (!intval(vB::$vbulletin->userinfo['userid']))
		{
			return '';
		}

		// Create view
		$view = new vB_View($config['template_name'] ? $config['template_name'] : 'vbcms_widget_searchwidget_page');
		$view->class = $this->widget->getClass();
		$view->title = $this->widget->getTitle();
		$view->description = $this->widget->getDescription();

		$results = $this->getResults($config);

		if (!count($results['results']))
		{
				return false;
		}
		$view->friends_html = $this->renderResult($config, $results);

		if (!$view->friends_html)
		{
			$view->setDisplayView(false);
		}

		$view->widget_title = $this->widget->getTitle();

		return $view;
	}