Skip to content

Commit

Permalink
Updating Joomla! RAD Layer to FOF 2.1.0 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas K. Dionysopoulos committed Nov 16, 2013
1 parent c2018b2 commit ac0ae41
Show file tree
Hide file tree
Showing 110 changed files with 568 additions and 356 deletions.
1 change: 1 addition & 0 deletions libraries/fof/autoloader/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* created on the fly.
*
* @package FrameworkOnFramework
* @subpackage autoloader
* @since 2.1
*/
class FOFAutoloaderComponent
Expand Down
5 changes: 3 additions & 2 deletions libraries/fof/autoloader/fof.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
/**
* The main class autoloader for FOF itself
*
* @package FrameworkOnFramework
* @since 2.1
* @package FrameworkOnFramework
* @subpackage autoloader
* @since 2.1
*/
class FOFAutoloaderFof
{
Expand Down
121 changes: 64 additions & 57 deletions libraries/fof/controller/controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* @package FrameworkOnFramework
* @subpackage controller
* @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Expand All @@ -13,7 +14,7 @@
* paradigm, where the controller is mainly used to set up the model state and
* spawn the view.
*
* @package FrameworkOnFramework.Controller
* @package FrameworkOnFramework
* @since 1.0
*/
class FOFController extends JObject
Expand Down Expand Up @@ -264,7 +265,7 @@ public static function &getAnInstance($option = null, $view = null, $config = ar
* @param string $view The view name, e.g. cpanel
* @param array $config Configuration parameters
*
* @return \className A disposable class instance
* @return \FOFController A disposable class instance
*/
public static function &getTmpInstance($option = null, $view = null, $config = array())
{
Expand Down Expand Up @@ -832,7 +833,7 @@ public function addViewPath($path)
*/
public function authorise($task)
{
JLog::add(__METHOD__ . ' is deprecated. Use checkACL() instead.', JLog::WARNING, 'deprecated');
FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' .__METHOD__ . ' is deprecated. Use checkACL() instead.');

return true;
}
Expand Down Expand Up @@ -888,14 +889,16 @@ protected static function createFileName($type, $parts = array())
return $filename;
}

/**
* Executes a given controller task. The onBefore<task> and onAfter<task>
* methods are called automatically if they exist.
*
* @param string $task The task to execute, e.g. "browse"
*
* @return null|bool False on execution failure
*/
/**
* Executes a given controller task. The onBefore<task> and onAfter<task>
* methods are called automatically if they exist.
*
* @param string $task The task to execute, e.g. "browse"
*
* @throws Exception Exception thrown if the onBefore<task> returns false
*
* @return null|bool False on execution failure
*/
public function execute($task)
{
$this->task = $task;
Expand Down Expand Up @@ -998,7 +1001,7 @@ public function execute($task)
* @param bool $cachable Is this view cacheable?
* @param bool $urlparams Add your safe URL parameters (see further down in the code)
*
* @return void
* @return bool
*/
public function display($cachable = false, $urlparams = false)
{
Expand Down Expand Up @@ -1119,7 +1122,7 @@ public function display($cachable = false, $urlparams = false)
* Implements a default browse task, i.e. read a bunch of records and send
* them to the browser.
*
* @return void
* @return boolean
*/
public function browse()
{
Expand Down Expand Up @@ -1158,7 +1161,7 @@ public function browse()
* Single record read. The id set in the request is passed to the model and
* then the item layout is used to render the result.
*
* @return void
* @return bool
*/
public function read()
{
Expand Down Expand Up @@ -1211,7 +1214,7 @@ public function read()
/**
* Single record add. The form layout is used to present a blank page.
*
* @return void
* @return false|void
*/
public function add()
{
Expand Down Expand Up @@ -1252,7 +1255,7 @@ public function add()
* Single record edit. The ID set in the request is passed to the model,
* then the form layout is used to edit the result.
*
* @return void
* @return bool
*/
public function edit()
{
Expand Down Expand Up @@ -1322,7 +1325,7 @@ public function edit()
/**
* Save the incoming data and then return to the Edit task
*
* @return void
* @return bool
*/
public function apply()
{
Expand Down Expand Up @@ -1358,7 +1361,7 @@ public function apply()
/**
* Duplicates selected items
*
* @return void
* @return bool
*/
public function copy()
{
Expand Down Expand Up @@ -1405,7 +1408,7 @@ public function copy()
/**
* Save the incoming data and then return to the Browse task
*
* @return void
* @return bool
*/
public function save()
{
Expand Down Expand Up @@ -1438,7 +1441,7 @@ public function save()
/**
* Save the incoming data and then return to the Add task
*
* @return void
* @return bool
*/
public function savenew()
{
Expand Down Expand Up @@ -1471,7 +1474,7 @@ public function savenew()
/**
* Cancel the edit, check in the record and return to the Browse task
*
* @return void
* @return bool
*/
public function cancel()
{
Expand Down Expand Up @@ -1503,7 +1506,7 @@ public function cancel()
/**
* Sets the access to public. Joomla! 1.5 compatibility.
*
* @return void
* @return bool
*
* @deprecated since 2.0
*/
Expand All @@ -1522,7 +1525,7 @@ public function accesspublic()
/**
* Sets the access to registered. Joomla! 1.5 compatibility.
*
* @return void
* @return bool
*
* @deprecated since 2.0
*/
Expand All @@ -1541,7 +1544,7 @@ public function accessregistered()
/**
* Sets the access to special. Joomla! 1.5 compatibility.
*
* @return void
* @return bool
*
* @deprecated since 2.0
*/
Expand All @@ -1560,7 +1563,7 @@ public function accessspecial()
/**
* Publish (set enabled = 1) an item.
*
* @return void
* @return bool
*/
public function publish()
{
Expand All @@ -1576,7 +1579,7 @@ public function publish()
/**
* Unpublish (set enabled = 0) an item.
*
* @return void
* @return bool
*/
public function unpublish()
{
Expand All @@ -1592,7 +1595,7 @@ public function unpublish()
/**
* Archive (set enabled = 2) an item.
*
* @return void
* @return bool
*/
public function archive()
{
Expand All @@ -1608,7 +1611,7 @@ public function archive()
/**
* Trash (set enabled = -2) an item.
*
* @return void
* @return bool
*/
public function trash()
{
Expand All @@ -1624,7 +1627,7 @@ public function trash()
/**
* Saves the order of the items
*
* @return void
* @return bool
*/
public function saveorder()
{
Expand Down Expand Up @@ -1687,7 +1690,7 @@ public function saveorder()
/**
* Moves selected items one position down the ordering list
*
* @return void
* @return bool
*/
public function orderdown()
{
Expand Down Expand Up @@ -1731,7 +1734,7 @@ public function orderdown()
/**
* Moves selected items one position up the ordering list
*
* @return void
* @return bool
*/
public function orderup()
{
Expand Down Expand Up @@ -1775,7 +1778,7 @@ public function orderup()
/**
* Delete selected item(s)
*
* @return void
* @return bool
*/
public function remove()
{
Expand Down Expand Up @@ -1988,7 +1991,7 @@ public function setRedirect($url, $msg = null, $type = null)
*
* @param integer $state The desired state. 0 is unpublished, 1 is published.
*
* @return void
* @return bool
*/
final protected function setstate($state = 0)
{
Expand Down Expand Up @@ -2027,7 +2030,7 @@ final protected function setstate($state = 0)
*
* @param integer $level The desired viewing access level ID
*
* @return void
* @return bool
*/
final protected function setaccess($level = 0)
{
Expand Down Expand Up @@ -2337,14 +2340,16 @@ final public function getThisView($config = array())
return $this->_viewObject;
}

/**
* Method to get the controller name
*
* The dispatcher name is set by default parsed using the classname, or it can be set
* by passing a $config['name'] in the class constructor
*
* @return string The name of the dispatcher
*/
/**
* Method to get the controller name
*
* The dispatcher name is set by default parsed using the classname, or it can be set
* by passing a $config['name'] in the class constructor
*
* @throws Exception
*
* @return string The name of the dispatcher
*/
public function getName()
{
if (empty($this->name))
Expand Down Expand Up @@ -2389,16 +2394,18 @@ public function getTasks()
return $this->methods;
}

/**
* Method to get a reference to the current view and load it if necessary.
*
* @param string $name The view name. Optional, defaults to the controller name.
* @param string $type The view type. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for view. Optional.
*
* @return FOFView Reference to the view or an error.
*/
/**
* Method to get a reference to the current view and load it if necessary.
*
* @param string $name The view name. Optional, defaults to the controller name.
* @param string $type The view type. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for view. Optional.
*
* @throws Exception
*
* @return FOFView Reference to the view or an error.
*/
public function getView($name = '', $type = '', $prefix = '', $config = array())
{
// Make sure $config is an array
Expand Down Expand Up @@ -2482,7 +2489,7 @@ protected function createModel($name, $prefix = '', $config = array())
*/
protected function &_createModel($name, $prefix = '', $config = array())
{
JLog::add(__METHOD__ . ' is deprecated. Use createModel() instead.', JLog::WARNING, 'deprecated');
FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' .__METHOD__ . ' is deprecated. Use createModel() instead.');

return $this->createModel($name, $prefix, $config);
}
Expand Down Expand Up @@ -2712,7 +2719,7 @@ protected function createView($name, $prefix = '', $type = '', $config = array()
*/
protected function &_createView($name, $prefix = '', $type = '', $config = array())
{
JLog::add(__METHOD__ . ' is deprecated. Use createView() instead.', JLog::WARNING, 'deprecated');
FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated. Use createView() instead.');

return $this->createView($name, $prefix, $type, $config);
}
Expand Down Expand Up @@ -2993,8 +3000,6 @@ protected function onBeforeEdit()
FOFInflector::singularize($this->view) . '.acl.edit', 'core.edit'
);

// Else go with the generic one

return $this->checkACL($privilege);
}

Expand Down Expand Up @@ -3124,6 +3129,8 @@ protected function onBeforeUnpublish()
* (depending the Joomla! version) if the check fails.
*
* @return boolean True if the CSRF check is successful
*
* @throws Exception
*/
protected function _csrfProtection()
{
Expand All @@ -3132,7 +3139,7 @@ protected function _csrfProtection()
if (is_null($isCli))
{
$isCli = FOFPlatform::getInstance()->isCli();
$iAdmin = FOFPlatform::getInstance()->isBackend();
$isAdmin = FOFPlatform::getInstance()->isBackend();
}

switch ($this->csrfProtection)
Expand Down

0 comments on commit ac0ae41

Please sign in to comment.