*/
class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
+ /**
+ * CRM_Activity_Tokens constructor.
+ */
public function __construct() {
parent::__construct('activity', array(
'activity_id' => ts('Activity ID'),
}
/**
+ * Get the default locale options.
+ *
* @return array
*/
public static function getDefaultLocaleOptions() {
CRM_Utils_System::setTitle(ts('Find Respondents To %1', array(1 => ucfirst($this->_operation))));
}
+ /**
+ * Load the default survey for all actions.
+ *
+ * @return array
+ */
public function setDefaultValues() {
- //load the default survey for all actions.
if (empty($this->_defaults)) {
$defaultSurveyId = key(CRM_Campaign_BAO_Survey::getSurveys(TRUE, TRUE));
if ($defaultSurveyId) {
CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
}
+ /**
+ * Set defaults for the pdf.
+ *
+ * @return array
+ */
public function setDefaultValues() {
return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
}
}
+ /**
+ * Run generator.
+ */
public function run() {
echo "Generating table list\n";
$template = new CRM_Core_CodeGen_Util_Template('php');
}
/**
+ * Get absolute file name.
+ *
* @return string
*/
protected function getAbsFileName() {
return $this->config->CoreDAOCodePath . "AllCoreTables.data.php";
}
+ /**
+ * Get the checksum for the schema.
+ *
+ * @return string
+ */
protected function getSchemaChecksum() {
if (!$this->checksum) {
CRM_Utils_Array::flatten($this->tables, $flat);
}
/**
+ * Run template generator.
+ *
* @param string $infile
* Filename of the template, without a path.
* @param string $outpath
}
}
+ /**
+ * Fetch via Smarty.
+ *
+ * @param string $infile
+ *
+ * @return string
+ */
public function fetch($infile) {
return $this->smarty->fetch($infile);
}
private $cache = array();
+ /**
+ * CRM_Core_Config_MagicMerge constructor.
+ */
public function __construct() {
$this->map = self::getPropertyMap();
}
+ /**
+ * Set the map to the property map.
+ */
public function __wakeup() {
$this->map = self::getPropertyMap();
}
);
}
+ /**
+ * Get value.
+ *
+ * @param string $k
+ *
+ * @return mixed
+ * @throws \CRM_Core_Exception
+ */
public function __get($k) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot read unrecognized property CRM_Core_Config::\${$k}.");
}
}
+ /**
+ * Set value.
+ *
+ * @param string $k
+ * @param mixed $v
+ *
+ * @throws \CRM_Core_Exception
+ */
public function __set($k, $v) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot set unrecognized property CRM_Core_Config::\${$k}");
}
}
+ /**
+ * Is value set.
+ *
+ * @param string $k
+ *
+ * @return bool
+ */
public function __isset($k) {
return isset($this->map[$k]);
}
+ /**
+ * Unset value.
+ *
+ * @param string $k
+ *
+ * @throws \CRM_Core_Exception
+ */
public function __unset($k) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot unset unrecognized property CRM_Core_Config::\${$k}");
return $this->settings;
}
+ /**
+ * Initialise local settings.
+ */
private function initLocals() {
if ($this->locals === NULL) {
$this->locals = array(
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
- * $Id$
- *
*/
class CRM_Core_DAO_AllCoreTables {
private static $daoToClass = NULL;
private static $entityTypes = NULL;
+ /**
+ * Initialise.
+ *
+ * @param bool $fresh
+ */
public static function init($fresh = FALSE) {
static $init = FALSE;
if ($init && !$fresh) {
/**
* (Quasi-Private) Do not call externally (except for unit-testing)
+ *
+ * @param string $daoName
+ * @param string $className
+ * @param string $tableName
+ * @param string $fields_callback
+ * @param string $links_callback
*/
public static function registerEntityType($daoName, $className, $tableName, $fields_callback = NULL, $links_callback = NULL) {
self::$daoToClass[$daoName] = $className;
return FALSE !== array_search($tableName, self::tables());
}
+ /**
+ * Get the DAO for the class.
+ *
+ * @param string $className
+ *
+ * @return string
+ */
public static function getCanonicalClassName($className) {
return str_replace('_BAO_', '_DAO_', $className);
}
/**
+ * Get a list of all DAO classes.
+ *
* @return array
* List of class names.
*/
return array_values(self::daoToClass());
}
+ /**
+ * Get the classname for the table.
+ *
+ * @param string $tableName
+ * @return string
+ */
public static function getClassForTable($tableName) {
//CRM-19677: on multilingual setup, trim locale from $tableName to fetch class name
if (CRM_Core_I18n::isMultilingual()) {
self::tables());
}
+ /**
+ * Reinitialise cache.
+ *
+ * @param bool $fresh
+ */
public static function reinitializeCache($fresh = FALSE) {
self::init($fresh);
}
$exports = array();
$fields = $dao::fields();
- foreach($fields as $name => $field) {
+ foreach ($fields as $name => $field) {
if (CRM_Utils_Array::value('export', $field)) {
if ($prefix) {
$exports[$labelName] = & $fields[$name];
- } else {
+ }
+ else {
$exports[$name] = & $fields[$name];
}
}
$imports = array();
$fields = $dao::fields();
- foreach($fields as $name => $field) {
+ foreach ($fields as $name => $field) {
if (CRM_Utils_Array::value('import', $field)) {
if ($prefix) {
$imports[$labelName] = & $fields[$name];
- } else {
+ }
+ else {
$imports[$name] = & $fields[$name];
}
}
*/
class CRM_Core_Error_Log extends \Psr\Log\AbstractLogger {
+ /**
+ * CRM_Core_Error_Log constructor.
+ */
public function __construct() {
$this->map = array(
\Psr\Log\LogLevel::DEBUG => PEAR_LOG_DEBUG,
CRM_Utils_System::setHttpHeader('Cache-Control', "max-age=$ttl, public");
}
+ /**
+ * Set defaults for sort and pager.
+ *
+ * @param int $defaultOffset
+ * @param int $defaultRowCount
+ * @param string $defaultSort
+ * @param string $defaultsortOrder
+ *
+ * @return array
+ */
public static function defaultSortAndPagerParams($defaultOffset = 0, $defaultRowCount = 25, $defaultSort = NULL, $defaultsortOrder = 'asc') {
$params = array(
'_raw_values' => array(),
*/
class CRM_Core_Page_File extends CRM_Core_Page {
+ /**
+ * Run page.
+ */
public function run() {
$fileName = CRM_Utils_Request::retrieve('filename', 'String', $this);
$path = CRM_Core_Config::singleton()->customFileUploadDir . $fileName;
require_once 'eWAY/eWAY_GatewayRequest.php';
require_once 'eWAY/eWAY_GatewayResponse.php';
+/**
+ * Class CRM_Core_Payment_eWAY.
+ */
class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
# (not used, implicit in the API, might need to convert?)
const CHARSET = 'UTF-8';
&& $processor->context['actionMapping']->getEntity() === 'civicrm_participant';
}
+ /**
+ * Alter action schedule query.
+ *
+ * @param \Civi\ActionSchedule\Event\MailingQueryEvent $e
+ */
public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e) {
if ($e->mapping->getEntity() !== 'civicrm_participant') {
return;
const REPORT_GROUP_NAME = 'report_template';
+ /**
+ * CRM_Extension_Manager_Report constructor.
+ */
public function __construct() {
parent::__construct(TRUE);
$this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
const CUSTOM_SEARCH_GROUP_NAME = 'custom_search';
+ /**
+ * CRM_Extension_Manager_Search constructor.
+ */
public function __construct() {
parent::__construct(TRUE);
$this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
return 'CRM_Batch_BAO_Batch';
}
+ /**
+ * Get links.
+ */
public function &links() {
}
$this->diffs = $differ->diffsInTables($tables);
}
+ /**
+ * Setter for diffs.
+ *
+ * @param array $diffs
+ */
public function setDiffs($diffs) {
$this->diffs = $diffs;
}
return !empty($processor->context['mailingId']) || !empty($processor->context['mailing']);
}
+ /**
+ * Prefetch tokens.
+ *
+ * @param \Civi\Token\Event\TokenValueEvent $e
+ *
+ * @return array
+ * @throws \Exception
+ */
public function prefetch(\Civi\Token\Event\TokenValueEvent $e) {
$processor = $e->getTokenProcessor();
$mailing = isset($processor->context['mailing'])
}
/**
+ * Make a valid file name.
+ *
* @param string $name
*
* @return string
}
/**
- * @param $path
- * @param $ext
+ * Get files for the extension.
+ *
+ * @param string $path
+ * @param string $ext
*
* @return array
*/
return TRUE;
}
+ /**
+ * Format file.
+ *
+ * @param array $param
+ * @param string $fileName
+ * @param array $extraParams
+ */
public static function formatFile(&$param, $fileName, $extraParams = array()) {
if (empty($param[$fileName])) {
return;
require_once 'TbsZip/tbszip.php';
+/**
+ * Class CRM_Utils_PDF_Document.
+ */
class CRM_Utils_PDF_Document {
public static $ooxmlMap = array(
);
/**
+ * Convert html to a Doc file.
+ *
* @param array $pages
* @param string $fileName
* @param array|int $format
$base_url = str_replace('http://', 'https://', $base_url);
}
+ /**
+ * Get the name of the table that stores the user details.
+ *
+ * @return string
+ */
protected function getUsersTableName() {
$userFrameworkUsersTableName = Civi::settings()->get('userFrameworkUsersTableName');
if (empty($userFrameworkUsersTableName)) {
return 'left';
}
+ /**
+ * Get the absolute path to the site's base url.
+ *
+ * @return bool|mixed|string
+ */
public function getAbsoluteBaseURL() {
if (!defined('CIVICRM_UF_BASEURL')) {
return FALSE;
return $url;
}
+ /**
+ * Get the relative path to the sites base url.
+ *
+ * @return bool
+ */
public function getRelativeBaseURL() {
$absoluteBaseURL = $this->getAbsoluteBaseURL();
if ($absoluteBaseURL === FALSE) {
$base_url = str_replace('http://', 'https://', $base_url);
}
+ /**
+ * Get the name of the table that stores the user details.
+ *
+ * @return string
+ */
protected function getUsersTableName() {
$userFrameworkUsersTableName = Civi::settings()->get('userFrameworkUsersTableName');
if (empty($userFrameworkUsersTableName)) {
<?php
-
+/**
+ * Get the CiviCRM version.
+ */
function civicrmVersion( ) {ldelim}
{include file="../../templates/CRM/common/version.tpl" assign=svnrevision}
return array( 'version' => '{$db_version}',
'cms' => '{$cms}',
- 'revision' => '{$svnrevision}' );
+ 'revision' => '{$svnrevision}', );
{rdelim}