* PHP version 5.3
*
* @category Toolkit
- * @package Package
+ * @package Property
* @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
* @license Gaslight Media
* @version SVN: (0.1)
* @link <>
/**
* Toolkit_Package_Controller
*
- * Description of Controller
+ * Controller Class for running the admin application for properties
*
* @category Toolkit
- * @package Package
+ * @package Property
* @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
* @license Gaslight Media
* @release Release: (0.1)
* @link <>
const PROPERTY_IMAGE_STYLE = 'propertyImage';
const ADDRESS_EDITABLE = false;
+ /**
+ * Create the Controller Object
+ *
+ * @return void
+ */
public function __construct()
{
$this->smarty = new \Toolkit_Smarty(
$this->dbh = \Toolkit_Database::getInstance();
}
+ /**
+ * Filters the POST array.
+ *
+ * @return array Filtered array of posted key value pairs
+ */
public function getFilteredPostData()
{
return filter_var_array(
);
}
- public function processImages()
+ /**
+ * Processes data for the property.
+ *
+ * If the $_FILES array contains an empty value then the hidden field
+ * is used.
+ *
+ * @return void
+ */
+ private function _processProperty()
{
$file1Uploaded = false;
if (!$_FILES['image']['error']) {
$property->save($this->dbh);
}
+ /**
+ * Outputs the html for the administration area.
+ *
+ * @return void
+ */
public function toHtml()
{
if ($_POST || $_FILES) {
- $this->processImages();
+ $this->_processProperty();
header('Location: ' . $_SERVER['PHP_SELF']);
exit;
}
echo $this->smarty->fetch('index.tpl');
}
+ /**
+ * Returns an array of properties
+ *
+ * @return array Properties in an array
+ */
public function getProperties()
{
$mapper = new \Property\Models\Property();
* PHP version 5.3
*
* @category Toolkit
- * @package Package
+ * @package Property
* @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
* @license Gaslight Media
* @version SVN: (0.1)
* @link <>
* Description of Image
*
* @category Toolkit
- * @package Package
+ * @package Property
* @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
* @license Gaslight Media
* @release Release: (0.1)
* @link <>