Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third CS and access PR (views) #5

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions libraries/cms/component/dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

defined('JPATH_PLATFORM') or die;

/**
* @todo explain here
*
* @package Joomla.Libraries
* @subpackage Dispatcher
* @since 3.4
*/
class JComponentDispatcher implements JComponentDispatcherInterface
{
// Constants that define the form of the controller passed in the URL
Expand All @@ -17,25 +24,33 @@ class JComponentDispatcher implements JComponentDispatcherInterface
const CONTROLLER_VIEW_FOLDER = 2;

/**
* @var JControllerCmsInterface The Task Controller.
* The Task Controller.
*
* @var JControllerCmsInterface
* @since 3.4
*/
protected $controller;

/**
* @var string The name of the default view, in case none is specified.
* The name of the default view, in case none is specified.
*
* @var string
* @since 3.4
*/
public $defaultView = 'cpanel';

/**
* @var JInput The input object.
* The input object.
*
* @var JInput
* @since 3.4
*/
protected $input = null;

/**
* @var array The configuration to be injected.
* The configuration to be injected.
*
* @var array
* @since 3.4
*/
protected $config = array();
Expand All @@ -50,6 +65,7 @@ class JComponentDispatcher implements JComponentDispatcherInterface
*
* @return JComponentDispatcher
*
* @since 3.4
* @throws InvalidArgumentException
*/
public static function getInstance($option, $view = null, JInput $input = null, $config = array())
Expand Down Expand Up @@ -137,6 +153,7 @@ public static function getInstance($option, $view = null, JInput $input = null,
* @param JInput $input The input class
* @param array $config A config array
*
* @since 3.4
* @throws InvalidArgumentException
*/
public function __construct($option, JInput $input = null, $config = array())
Expand Down Expand Up @@ -169,6 +186,7 @@ public function __construct($option, JInput $input = null, $config = array())
*
* @return void
*
* @since 3.4
* @throws RuntimeException
*/
public function dispatch(JApplicationCms $app = null)
Expand Down Expand Up @@ -198,6 +216,7 @@ public function dispatch(JApplicationCms $app = null)
*
* @return JControllerCmsInterface
*
* @since 3.4
* @throws InvalidArgumentException
*/
public function getController(JApplicationCms $app = null)
Expand Down Expand Up @@ -249,6 +268,7 @@ public function getController(JApplicationCms $app = null)
*
* @return SplPriorityQueue An SplPriorityQueue containing potential class names
*
* @since 3.4
* @throws InvalidArgumentException
*/
protected function getControllerNames()
Expand Down Expand Up @@ -302,6 +322,8 @@ protected function getControllerNames()
* Gets the default controller prefix
*
* @return string The default component view
*
* @since 3.4
*/
protected function getControllerPrefix()
{
Expand All @@ -312,6 +334,8 @@ protected function getControllerPrefix()
* Gets the default controller activity
*
* @return string The default component view
*
* @since 3.4
*/
protected function getControllerActivity()
{
Expand All @@ -322,6 +346,8 @@ protected function getControllerActivity()
* Gets the default controller view
*
* @return string The default component view
*
* @since 3.4
*/
protected function getControllerView()
{
Expand All @@ -338,6 +364,8 @@ protected function getControllerView()
* not prefixed with J.
*
* @return array The tasks in the form listed above
*
* @since 3.4
*/
public function getTasks()
{
Expand Down
24 changes: 12 additions & 12 deletions libraries/cms/view/feed/category.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @package Joomla.Legacy
* @package Joomla.Libraries
* @subpackage View
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
Expand All @@ -12,9 +12,9 @@
/**
* Base feed View class for a category
*
* @package Joomla.Legacy
* @package Joomla.Libraries
* @subpackage View
* @since 3.2
* @since 3.4
*/
class JViewFeedCategory extends JViewCms
{
Expand All @@ -39,24 +39,24 @@ public function render()
$app = JFactory::getApplication();
$document = JFactory::getDocument();

$extension = $app->input->getString('option');
$extension = $app->input->getString('option');
$contentType = $extension . '.' . $this->viewName;

$ucmType = new JUcmType;
$ucmRow = $ucmType->getTypeByAlias($contentType);
$ucmType = new JUcmType;
$ucmRow = $ucmType->getTypeByAlias($contentType);
$ucmMapCommon = json_decode($ucmRow->field_mappings)->common;
$createdField = null;
$titleField = null;
$titleField = null;

if (is_object($ucmMapCommon))
{
$createdField = $ucmMapCommon->core_created_time;
$titleField = $ucmMapCommon->core_title;
$titleField = $ucmMapCommon->core_title;
}
elseif (is_array($ucmMapCommon))
{
$createdField = $ucmMapCommon[0]->core_created_time;
$titleField = $ucmMapCommon[0]->core_title;
$titleField = $ucmMapCommon[0]->core_title;
}

$document->link = JRoute::_(JHelperRoute::getCategoryRoute($app->input->getInt('id'), $language = 0, $extension));
Expand All @@ -72,8 +72,8 @@ public function render()
$document->editorEmail = $siteEmail;
}

$data = $this->getData();
$items = $data['items'];
$data = $this->getData();
$items = $data['items'];
$category = $data['category'];

foreach ($items as $item)
Expand Down Expand Up @@ -143,7 +143,7 @@ public function render()
*
* @return void
*
* @since 3.2
* @since 3.4
*/
protected function reconcileNames($item)
{
Expand Down
18 changes: 8 additions & 10 deletions libraries/cms/view/html/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@
*
* @package Joomla.Libraries
* @subpackage View
* @since 3.2
* @since 3.4
*/
class JViewHtmlCategories extends JViewHtmlLegacy
{
/**
* State data
*
* @var JRegistry
* @since 3.2
* @since 3.4
*/
protected $state;

/**
* Category items data
*
* @var array
* @since 3.2
* @since 3.4
*/
protected $items;

/**
* Language key for default page heading
*
* @var string
* @since 3.2
* @since 3.4
*/
protected $pageHeading;

Expand All @@ -49,16 +49,15 @@ class JViewHtmlCategories extends JViewHtmlLegacy
*
* @return mixed A string if successful, otherwise a Error object.
*
* @since 3.2
* @since 3.4
*/
public function render()
{
$model = $this->getModel();
$state = $model->getState();
$items = $model->getItems();
$parent = $model->getParent();

$app = JFactory::getApplication();
$app = JFactory::getApplication();

if ($items === false)
{
Expand All @@ -75,8 +74,7 @@ public function render()
}

$params = &$state->get('params');

$items = array($parent->id => $items);
$items = array($parent->id => $items);

// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
Expand All @@ -96,7 +94,7 @@ public function render()
*
* @return void
*
* @since 3.2
* @since 3.4
*/
protected function prepareDocument()
{
Expand Down
Loading