<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @var int
*/
// move the values from the session to the template
- CONST SESSION = 1, TEMPLATE = 2,
- TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
+ const SESSION = 1, TEMPLATE = 2,
+ TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
/**
- * A CRM Object that implements CRM_Core_Selector_API
+ * A CRM Object that implements CRM_Core_Selector_API.
* @var object
*/
protected $_object;
* so the display routine needs to not do any work. (The
* parent object takes care of the display)
*
- * @var boolean
+ * @var bool
*/
protected $_embedded = FALSE;
* Are we in print mode? if so we need to modify the display
* functionality to do a minimal display :)
*
- * @var boolean
+ * @var bool
*/
protected $_print = FALSE;
* Array of properties that the controller dumps into the output object
*
* @var array
- * @static
*/
public static $_properties = array('columnHeaders', 'rows', 'rowsEmpty');
/**
* Should we compute actions dynamically (since they are quite verbose)
*
- * @var boolean
+ * @var bool
*/
protected $_dynamicAction = FALSE;
/**
- * Class constructor
+ * Class constructor.
*
- * @param CRM_Core_Selector_API $object an object that implements the selector API
- * @param int $pageID default pageID
- * @param int $sortID default sortID
- * @param int $action the actions to potentially support
+ * @param CRM_Core_Selector_API $object
+ * An object that implements the selector API.
+ * @param int $pageID
+ * Default pageID.
+ * @param int $sortID
+ * Default sortID.
+ * @param int $action
+ * The actions to potentially support.
* @param CRM_Core_Page|CRM_Core_Form $store place in session to store some values
- * @param int $output what do we so with the output, session/template//both
+ * @param int $output
+ * What do we so with the output, session/template//both.
*
* @param null $prefix
* @param null $case
*
* @return \CRM_Core_Selector_Controller
- @access public
*/
- function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL) {
+ public function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL) {
$this->_object = $object;
$this->_pageID = $pageID ? $pageID : 1;
$this->_sortID = $sortID ? $sortID : NULL;
$this->_action = $action;
- $this->_store = $store;
+ $this->_store = $store;
$this->_output = $output;
$this->_prefix = $prefix;
- $this->_case = $case;
+ $this->_case = $case;
// fix sortID
if ($this->_sortID && strpos($this->_sortID, '_') === FALSE) {
/**
* Have the GET vars changed, i.e. pageId or sortId that forces us to recompute the search values
*
- * @param int $reset are we being reset
+ * @param int $reset
+ * Are we being reset.
*
- * @return boolean if the GET params are different from the session params
- * @access public
+ * @return bool
+ * if the GET params are different from the session params
*/
- function hasChanged($reset) {
+ public function hasChanged($reset) {
/**
* if we are in reset state, i.e the store is cleaned out, we return false
*
*
* @return void
- *
*/
- function run() {
+ public function run() {
// get the column headers
$columnHeaders = &$this->_object->getColumnHeaders($this->_action, $this->_output);
$rows = self::getRows($this);
CRM_Utils_Hook::searchColumns($contextName, $columnHeaders, $rows, $this);
$rowsEmpty = count($rows) ? FALSE : TRUE;
- $qill = $this->getQill();
- $summary = $this->getSummary();
+ $qill = $this->getQill();
+ $summary = $this->getSummary();
// if we need to store in session, lets update session
if ($this->_output & self::SESSION) {
$this->_store->set("{$this->_prefix}columnHeaders", $columnHeaders);
self::$_template->assign("{$this->_prefix}summary", $summary);
}
-
// always store the current pageID and sortID
$this->_store->set($this->_prefix . CRM_Utils_Pager::PAGE_ID,
$this->_pager->getCurrentPageID()
*
* @param CRM_Core_Form $form
*
- * @return array of rows
- * @access public
+ * @return array
+ * Array of rows
*/
public function getRows($form) {
if ($form->_output == self::EXPORT || $form->_output == self::SCREEN) {
* Default function for qill, if needed to be implemented, we
* expect the subclass to do it
*
- * @return string the status message
- * @access public
+ * @return string
+ * the status message
*/
public function getQill() {
return $this->_object->getQill();
}
/**
- * Getter for pager
+ * Getter for pager.
*
* @return CRM_Utils_Pager
- * @access public
*/
- function getPager() {
+ public function getPager() {
return $this->_pager;
}
/**
- * Getter for sort
+ * Getter for sort.
*
* @return CRM_Utils_Sort
- * @access public
*/
- function getSort() {
+ public function getSort() {
return $this->_sort;
}
/**
- * Move the variables from the session to the template
+ * Move the variables from the session to the template.
*
* @return void
- * @access public
*/
- function moveFromSessionToTemplate() {
+ public function moveFromSessionToTemplate() {
self::$_template->assign_by_ref("{$this->_prefix}pager", $this->_pager);
$rows = $this->_store->get("{$this->_prefix}rows");
}
/**
- * Setter for embedded
+ * Setter for embedded.
*
- * @param boolean $embedded
+ * @param bool $embedded
*
* @return void
- * @access public
*/
- function setEmbedded($embedded) {
+ public function setEmbedded($embedded) {
$this->_embedded = $embedded;
}
/**
- * Getter for embedded
+ * Getter for embedded.
*
- * @return boolean return the embedded value
- * @access public
+ * @return bool
+ * return the embedded value
*/
- function getEmbedded() {
+ public function getEmbedded() {
return $this->_embedded;
}
/**
- * Setter for print
+ * Setter for print.
*
- * @param boolean $print
+ * @param bool $print
*
* @return void
- * @access public
*/
- function setPrint($print) {
+ public function setPrint($print) {
$this->_print = $print;
}
/**
- * Getter for print
+ * Getter for print.
*
- * @return boolean return the print value
- * @access public
+ * @return bool
+ * return the print value
*/
- function getPrint() {
+ public function getPrint() {
return $this->_print;
}
/**
* @param $value
*/
- function setDynamicAction($value) {
+ public function setDynamicAction($value) {
$this->_dynamicAction = $value;
}
/**
* @return bool
*/
- function getDynamicAction() {
+ public function getDynamicAction() {
return $this->_dynamicAction;
}
-}
+}