$this->setFields();
if ($this->_activityTypeFile) {
- eval("CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}::preProcess( \$this );");
+ $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}";
+ $className::preProcess($this);
}
$this->_values = $this->get('values');
}
if ($this->_activityTypeFile) {
- eval('$defaults += CRM_' . $this->_crmDir . '_Form_Activity_' .
- $this->_activityTypeFile . '::setDefaultValues($this);'
- );
+ $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}";
+ $defaults += $className::setDefaultValues($this);
}
if (!CRM_Utils_Array::value('priority_id', $defaults)) {
$priority = CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id');
}
if ($this->_activityTypeFile) {
- eval("CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}::buildQuickForm( \$this );");
- }
+ $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}";
- if ($this->_activityTypeFile) {
- eval('$this->addFormRule' .
- "(array(
- 'CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}', 'formrule'), \$this);"
- );
+ $className::buildQuickForm($this);
+ $this->addFormRule(array($className, 'formRule'), $this);
}
$this->addFormRule(array('CRM_Activity_Form_Activity', 'formRule'), $this);
*/
function beginPostProcess(&$params) {
if ($this->_activityTypeFile) {
- eval("CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}" .
- "::beginPostProcess( \$this, \$params );"
- );
+ $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}";
+ $className::beginPostProcess($this, $params);
}
}
*/
function endPostProcess(&$params, &$activity) {
if ($this->_activityTypeFile) {
- eval("CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}" .
- "::endPostProcess( \$this, \$params, \$activity );"
- );
+ $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}";
+ $className::endPostProcess($this, $params, $activity );
}
}
}
if (isset($this->_id)) {
$params = array('id' => $this->_id);
// this is needed if the form is outside the CRM name space
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $this->_values );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $this->_values );
}
}
if (isset($this->_id) && empty($this->_values)) {
$this->_values = array();
$params = array('id' => $this->_id);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $this->_values );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $this->_values );
}
$defaults = $this->_values;
) {
$defaults = $params = array();
$params = array('id' => $this->_id);
- eval($this->_BAOName . '::retrieve( $params, $defaults );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $defaults);
$defaults['contact_types_a'] = CRM_Utils_Array::value('contact_type_a', $defaults);
if (CRM_Utils_Array::value('contact_sub_type_a', $defaults)) {
$defaults['contact_types_a'] .= CRM_Core_DAO::VALUE_SEPARATOR . $defaults['contact_sub_type_a'];
//when custom data is included in this page
CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_activityTypeId, 1, 'Activity');
- eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}::preProcess( \$this );");
+ $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}";
+ $className::preProcess($this);
$activityGroupTree = $this->_groupTree;
// for case custom fields to populate with defaults
if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW || $this->_cdType) {
return TRUE;
}
- eval('$defaults = CRM_Case_Form_Activity_' . $this->_activityTypeFile . '::setDefaultValues($this);');
+ $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}";
+ $defaults = $className::setDefaultValues($this);
$defaults = array_merge($defaults, CRM_Custom_Form_CustomData::setDefaultValues($this));
return $defaults;
}
)
);
- eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}::buildQuickForm( \$this );");
+ $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}";
+ $className::buildQuickForm($this);
}
/**
if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW || $this->_cdType) {
return TRUE;
}
- eval('$this->addFormRule' . "(array('CRM_Case_Form_Activity_{$this->_activityTypeFile}', 'formrule'), \$this);");
+ $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}";
+ $this->addFormRule(array($className, 'formRule'), $this);
$this->addFormRule(array('CRM_Case_Form_Case', 'formRule'), $this);
}
// 1. call begin post process
if ($this->_activityTypeFile) {
- eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::beginPostProcess( \$this, \$params );");
+ $className = "CRM_Case_Form_Activity_{$this->_activityTypeFile}";
+ $className::beginPostProcess($this, $params );
}
- if (CRM_Utils_Array::value('hidden_custom', $params) &&
+ if (
+ CRM_Utils_Array::value('hidden_custom', $params) &&
!isset($params['custom'])
) {
$customFields = array();
- $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
+ $params['custom'] = CRM_Core_BAO_CustomField::postProcess(
+ $params,
$customFields,
NULL,
'Case'
// 4. call end post process
if ($this->_activityTypeFile) {
- eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::endPostProcess( \$this, \$params );");
+ $className::endPostProcess($this, $params );
}
// 5. auto populate activites
static $_suffix = '.php';
- static $_preCall = array(
- 'singleton' => '',
- 'business' => 'new',
- 'data' => 'new',
- );
-
- static $_extCall = array(
- 'singleton' => '::singleton',
- 'business' => '',
- 'data' => '',
- );
-
-
- static
- function &create($className) {
+ static function &create($className) {
$type = CRM_Utils_Array::value($className, self::$_classes);
if (!$type) {
return CRM_Core_DAO_Factory::create($className);
require_once ($file . self::$_suffix);
- $newObj = eval(sprintf("return %s %s%s();",
- self::$_preCall[$type],
- $class,
- self::$_extCall[$type]
- ));
+ if ($type == 'singleton') {
+ $newObj = $class::singleton();
+ }
+ else {
+ // this is either 'business' or 'data'
+ $newObj = new $class;
+ }
return $newObj;
}
}
-
$this->_paneTemplatePath[$type] = $c->getAdvancedSearchPaneTemplatePath();
}
else {
- eval('CRM_Contact_Form_Search_Criteria::' . $type . '( $this );');
+ CRM_Contact_Form_Search_Criteria::$type($this);
$template = ucfirst($type);
$this->_paneTemplatePath[$type] = "CRM/Contact/Form/Search/Criteria/{$template}.tpl";
}
$title = trim($fields['newGroupName']);
$name = CRM_Utils_String::titleToVar($title);
$query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
- $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(1 => array($name, 'String'),
+ $grpCnt = CRM_Core_DAO::singleValueQuery(
+ $query,
+ array(
+ 1 => array($name, 'String'),
2 => array($title, 'String'),
- ));
+ )
+ );
if ($grpCnt) {
$invalidGroupName = TRUE;
$errors['newGroupName'] = ts('Group \'%1\' already exists.', array(1 => $fields['newGroupName']));
$relationType = new CRM_Contact_DAO_RelationshipType();
$relationType->id = $id;
$relationType->find(TRUE);
- eval('$mapperRelatedContactType[$key] = $relationType->contact_type_' . $second . ';');
+ $fieldName = "contact_type_$second";
+ $mapperRelatedContactType[$key] = $relationType->$fieldName;
$mapperRelated[$key] = $mapper[$key][0];
$mapperRelatedContactDetails[$key] = $mapper[$key][1];
$mapperRelatedContactLocType[$key] = $mapper[$key][2];
public function setJobParams(&$params) {
foreach ($params as $param => $value) {
- eval("\$this->_$param = \$value;");
+ $fldName = "_$param";
+ $this->$fldName = $value;
}
}
if ($value) {
$componentMode = $this->_controller->get('component_mode');
$modeValue = CRM_Contact_Form_Search::getModeValue($componentMode);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $modeValue['taskClassName']) . '.php');
- return eval("return {$modeValue['taskClassName']}::getTask( $value );");
+ $taskClassName = $modeValue['taskClassName'];
+ return $taskClassName::getTask($value);
}
else {
return CRM_Contact_Task::getTask($value);
if (isset($this->_id)) {
$params = array('id' => $this->_id);
if (!empty( $this->_BAOName)) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $defaults );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $defaults);
}
}
if ($this->_action == CRM_Core_Action::DELETE && CRM_Utils_Array::value('name', $defaults)) {
if ($parentId = CRM_Utils_Array::value('parent_id', $defaults)) {
$this->assign('parentId', $parentId);
}
- }
+ }
return $defaults;
}
if ($form->_online) {
$feeAmount->freeze();
}
-
+
$netAmount = & $form->add('text', 'net_amount', ts('Net Amount'),
$attributes['net_amount']
);
);
$form->add('textarea', 'note', ts('Notes'), array("rows" => 4, "cols" => 60));
-
+
$statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
if ($form->_id && $form->_values['contribution_status_id'] == array_search('Cancelled', $statusName)) {
$netAmount->freeze();
$feeAmount->freeze();
}
-
+
}
/**
$funName = ($chartType == 'bvg') ? 'barChart' : 'pieChart';
// build the chart objects.
- eval("\$values['object'] = CRM_Utils_OpenFlashChart::" . $funName . '( $values );');
+ $values['object'] = CRM_Utils_OpenFlashChart::$funName($values);
//build the urls.
$urlCnt = 0;
* @static
*
*/
- public static function &getTree($entityType,
+ public static function &getTree(
+ $entityType,
&$form,
$entityID = NULL,
$groupID = NULL,
// description is expected to be a callback func to subtypes
list($callback, $args) = explode(';', trim($ovValues['description']));
- if (!empty($args)) {
- eval('$args = ' . $args . ';');
- }
- else {
+ if (empty($args)) {
$args = array();
}
foreach ($components as $componentName => $obj) {
if (in_array($componentName, $config->enableComponents)) {
- eval('$obj->creatNewShortcut( $shortCuts, $newCredit );');
+ $obj->creatNewShortcut($shortCuts, $newCredit);
}
}
}
static $_suffix = '.php';
- static $_preCall = array(
- 'singleton' => '',
- 'business' => 'new',
- 'data' => 'new',
- );
-
- static $_extCall = array(
- 'singleton' => '::singleton',
- 'business' => '',
- 'data' => '',
- );
-
-
- static
- function &create($className) {
+ static function &create($className) {
$type = CRM_Utils_Array::value($className, self::$_classes);
if (!$type) {
CRM_Core_Error::fatal("class $className not found");
require_once ($file . self::$_suffix);
- $newObj = eval(sprintf("return %s %s%s();",
- self::$_preCall[$type],
- $class,
- self::$_extCall[$type]
- ));
+ if ($type == 'singleton') {
+ $newObj = $class::singleton();
+ }
+ else {
+ // this is either 'business' or 'data'
+ $newObj = new $class;
+ }
return $newObj;
}
}
-
return;
}
- eval("\$columns =& $class::columns();");
- eval("\$indices =& $class::indices();");
+ $columns =& $class::columns();
+ $indices =& $class::indices();
$queries = array();
$dropQueries = array();
// drop indices
else {
$class = 'CRM_Core_I18n_SchemaStructure';
}
- eval("\$indices =& $class::indices();");
- eval("\$tables =& $class::tables();");
+ $indices =& $class::indices();
+ $tables =& $class::tables();
$queries = array();
$dao = new CRM_Core_DAO;
// class loader look for file like - CRM/Core/I18n/SchemaStructure/4/1/0.php which is not what we want to be loaded
require_once "CRM/Core/I18n/SchemaStructure_{$latest}.php";
$class = "CRM_Core_I18n_SchemaStructure_{$latest}";
- eval("\$tables =& $class::tables();");
+ $tables =& $class::tables();
}
else {
$tables = CRM_Core_I18n_SchemaStructure::tables();
* @return array array of CREATE INDEX queries
*/
private static function createIndexQueries($locale, $table, $class = 'CRM_Core_I18n_SchemaStructure') {
- eval("\$indices =& $class::indices();");
- eval("\$columns =& $class::columns();");
+ $indices =& $class::indices();
+ $columns =& $class::columns();
if (!isset($indices[$table])) {
return array();
}
* @return array array of CREATE INDEX queries
*/
private static function createViewQuery($locale, $table, &$dao, $class = 'CRM_Core_I18n_SchemaStructure') {
- eval("\$columns =& $class::columns();");
+ $columns =& $class::columns();
$cols = array();
$dao->query("DESCRIBE {$table}", FALSE);
while ($dao->fetch()) {
$class = 'CRM_Core_I18n_SchemaStructure';
}
- eval("\$columns =& $class::columns();");
+ $columns =& $class::columns();
foreach ($columns as $table => $hash) {
if ($tableName &&
}
//load the object.
- self::$_singleton[$cacheKey] = eval('return ' . $paymentClass . '::singleton( $mode, $paymentProcessor );');
+ self::$_singleton[$cacheKey] = $paymentClass::singleton($mode, $paymentProcessor);
}
//load the payment form for required processor.
}
// Instantiate PP
- eval('$processorInstance = ' . $paymentClass . '::singleton( $mode, $paymentProcessor );');
+ $processorInstance = $paymentClass::singleton($mode, $paymentProcessor);
// Does PP implement this method, and can we call it?
if (!method_exists($processorInstance, $method) ||
*
* @return string
*/
- function getValue($daoName, $fieldName, $key, $params = array()) {
+ static function getValue($daoName, $fieldName, $key, $params = array()) {
$values = self::get($daoName, $fieldName, $params);
return CRM_Utils_Array::value($key, $values);
}
*
* @return string
*/
- function getKey($daoName, $fieldName, $value, $params = array()) {
+ static function getKey($daoName, $fieldName, $value, $params = array()) {
$values = self::get($daoName, $fieldName, $params);
return CRM_Utils_Array::key($value, $values);
}
}
return self::$activityType[$index];
}
-
+
/**
* Get all the State/Province from database.
*
public function buildQuickForm() {
//load form for child blocks
if ($this->_addBlockName) {
- return eval('CRM_Contact_Form_Edit_' . $this->_addBlockName . '::buildQuickForm( $this );');
+ $className = "CRM_Contact_Form_Edit_{$this->_addBlockName}";
+ return $className::buildQuickForm($this);
}
$this->applyFilter('__ALL__', 'trim');
/**
* various Contact types
*/
- CONST EXPORT_ALL = 1, EXPORT_SELECTED = 2, EXPORT_MERGE_DO_NOT_MERGE = 0, EXPORT_MERGE_SAME_ADDRESS = 1, EXPORT_MERGE_HOUSEHOLD = 2;
+ CONST
+ EXPORT_ALL = 1,
+ EXPORT_SELECTED = 2,
+ EXPORT_MERGE_DO_NOT_MERGE = 0,
+ EXPORT_MERGE_SAME_ADDRESS = 1,
+ EXPORT_MERGE_HOUSEHOLD = 2;
/**
* export modes
*/
- CONST CONTACT_EXPORT = 1, CONTRIBUTE_EXPORT = 2, MEMBER_EXPORT = 3, EVENT_EXPORT = 4, PLEDGE_EXPORT = 5, CASE_EXPORT = 6, GRANT_EXPORT = 7, ACTIVITY_EXPORT = 8;
+ CONST
+ CONTACT_EXPORT = 1,
+ CONTRIBUTE_EXPORT = 2,
+ MEMBER_EXPORT = 3,
+ EVENT_EXPORT = 4,
+ PLEDGE_EXPORT = 5,
+ CASE_EXPORT = 6,
+ GRANT_EXPORT = 7,
+ ACTIVITY_EXPORT = 8;
/**
* current export mode
$components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
if (in_array($componentName[1], $components)) {
- eval('$this->_exportMode = self::' . strtoupper($componentName[1]) . '_EXPORT;');
- eval('CRM_' . $componentName[1] . '_Form_Task::preProcessCommon( $this, true );');
+ $fieldName = strtoupper($componentName[1]) . '_EXPORT';
+ $this->_exportMode = self::$fieldName;
+ $className = "CRM_{$componentName[1]}_Form_Task";
+ $className::preProcessCommon( $this, true );
$values = $this->controller->exportValues('Search');
}
else {
}
else {
$this->assign('taskName', "Export $componentName[1]");
- eval('$componentTasks = CRM_' . $componentName[1] . '_Task::tasks();');
+ $className = "CRM_{$componentName[1]}_Task";
+ $componentTasks = $className::tasks();
$taskName = $componentTasks[$this->_task];
$component = TRUE;
}
case 'disable':
// Instantiate PP
- eval('$processorInstance = ' . $paymentClass . '::singleton( null, $paymentProcessor );');
+ $processorInstance = $paymentClass::singleton(NULL, $paymentProcessor);
// Does PP implement this method, and can we call it?
if (method_exists($processorInstance, $method) && is_callable(array(
function __construct() {
parent::__construct();
}
-
+
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
*
* @param array $params reference array contains the values submitted by the form
* @param array $ids reference array contains the id
- *
+ *
* @access public
- * @static
+ * @static
* @return object
*/
static function add(&$params, &$ids) {
$query = 'UPDATE civicrm_financial_account SET is_default = 0 WHERE financial_account_type_id = %1';
$queryParams = array(1 => array($params['financial_account_type_id'], 'Integer'));
CRM_Core_DAO::executeQuery($query, $queryParams);
- }
-
+ }
+
// action is taken depending upon the mode
$financialAccount = new CRM_Financial_DAO_FinancialAccount();
$financialAccount->copyValues($params);
$financialAccount->save();
return $financialAccount;
}
-
+
/**
- * Function to delete financial Types
- *
+ * Function to delete financial Types
+ *
* @param int $financialAccountId
* @static
*/
static function del($financialAccountId) {
- //checking if financial type is present
+ //checking if financial type is present
$check = FALSE;
-
+
//check dependencies
- $dependancy = array(
- array('Core', 'FinancialTrxn', 'to_financial_account_id'),
- array('Financial', 'FinancialTypeAccount', 'financial_account_id'),
+ $dependancy = array(
+ array('Core', 'FinancialTrxn', 'to_financial_account_id'),
+ array('Financial', 'FinancialTypeAccount', 'financial_account_id'),
);
foreach ($dependancy as $name) {
require_once (str_replace('_', DIRECTORY_SEPARATOR, "CRM_" . $name[0] . "_BAO_" . $name[1]) . ".php");
- eval('$bao = new CRM_' . $name[0] . '_BAO_' . $name[1] . '();');
+ $className = "CRM_{$name[0]}_BAO_{$name[1]}";
+ $bao = new $className();
$bao->$name[2] = $financialAccountId;
if ($bao->find(TRUE)) {
$check = TRUE;
}
}
-
+
if ($check) {
CRM_Core_Session::setStatus(ts('This financial account cannot be deleted since it is being used as a header account. Please remove it from being a header account before trying to delete it again.'));
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/financial/financialAccount', "reset=1&action=browse"));
}
-
+
//delete from financial Type table
$financialAccount = new CRM_Financial_DAO_FinancialAccount();
$financialAccount->id = $financialAccountId;
$financialAccount->delete();
}
-
+
/**
* get accounting code for a financial type with account relation Income Account is
*
);
return CRM_Core_DAO::singleValueQuery($query, $params);
}
-
+
/**
* get AR account
*
if (isset($this->_id)) {
$params = array('id' => $this->_id);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $defaults );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $defaults);
}
$defaults['is_active'] = 1;
if (isset($this->_id)) {
$params = array('id' => $this->_id);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $defaults );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $defaults);
}
if (isset($defaults['minimum_fee'])) {
$showAdditionalInfo = TRUE;
$allPanes[$name]['open'] = 'true';
}
- eval('CRM_Contribute_Form_AdditionalInfo::build' . $type . '( $this );');
+ $fnName = "build{$type}";
+ CRM_Contribute_Form_AdditionalInfo::$fnName($this);
}
$this->assign('allPanes', $allPanes);
// higher preference to bao object
if (array_key_exists('bao', $table)) {
- require_once str_replace('_', DIRECTORY_SEPARATOR, $table['bao'] . '.php');
- eval("\$expFields = {$table['bao']}::exportableFields( );");
+ $baoName = $table['bao'];
+ $expFields = $baoName::exportableFields( );
}
elseif (array_key_exists('dao', $table)){
- require_once str_replace('_', DIRECTORY_SEPARATOR, $table['dao'] . '.php');
- eval("\$expFields = {$table['dao']}::export( );");
+ $daoName = $table['dao'];
+ $expFields = $daoName::export( );
}
else{
$expFields = array();
if (isset($field['clause'])) {
// FIXME: we not doing escape here. Better solution is to use two
// different types - data-type and filter-type
- eval("\$clause = \"{$field['clause']}\";");
+ $clause = $field['clause'];
}
else {
$value = CRM_Utils_Type::escape($value, $type);
CRM_Core_Error::fatal("Could not locate extension for {$providerName}.");
}
- self::$_singleton[$cacheKey] = eval('return ' . $paymentClass . '::singleton( $providerParams, $force );');
+ self::$_singleton[$cacheKey] = $paymentClass::singleton($providerParams, $force);
}
return self::$_singleton[$cacheKey];
}
'id' => $type,
);
- eval('CRM_UF_Form_AdvanceSetting::' . $type . '( $this );');
+ CRM_UF_Form_AdvanceSetting::$type($this);
}
$this->addButtons(array(
$versionName = self::$_numberMap[$versionParts[0]] . self::$_numberMap[$versionParts[1]];
if (!array_key_exists($versionName, $incrementalPhpObject)) {
- eval("\$incrementalPhpObject['$versionName'] = new CRM_Upgrade_Incremental_php_{$versionName};");
+ $className = "CRM_Upgrade_Incremental_php_{$versionName}";
+ $incrementalPhpObject['$versionName'] = new $className();
}
return $incrementalPhpObject[$versionName];
}
usleep(5000000);
}
- eval($config->geocodeMethod . '::format( $params, true );');
+ $className = $config->geocodeMethod;
+ $className::format( $params, true );
array_shift($params);
$maxTries--;
} while ((!isset($params['geo_code_1'])) &&
}
// validate date.
- eval('$valid = CRM_Utils_Rule::' . $ruleName . '( $dateVal );');
+ $valid = CRM_Utils_Rule::$ruleName($dateVal);
if ($valid) {
//format date and time to default.
}
if (!array_key_exists($block, $fields)) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, "CRM_Core_DAO_" . $block) . ".php");
- eval('$fields[$block] =& CRM_Core_DAO_' . $block . '::fields( );');
+ $className = "CRM_Core_DAO_$block";
+ $fields[$block] =& $className::fields( );
}
$blockCnt = count($params[$name]);
$openFlashChart = array();
if ($chart && is_array($params) && !empty($params)) {
// build the chart objects.
- eval("\$chartObj = CRM_Utils_OpenFlashChart::" . $chart . '( $params );');
+ $chartObj = CRM_Utils_OpenFlashChart::$chart($params);
$openFlashChart = array();
if ($chartObj) {
$loadCMSBootstrap = true;
}
- eval('$result =& ' . $this->ufClass . '::authenticate($name, $pass, $loadCMSBootstrap );');
+ $className = $this->ufClass;
+ $result =& $className::authenticate($name, $pass, $loadCMSBootstrap );
if (empty($result)) {
throw new SoapFault('Client', 'Invalid login');
*/
function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) {
if (isset(self::$ufClass)) {
- eval('$url = ' . self::$ufClass . '::url($path, $query, $absolute, $fragment);');
+ $className = self::$ufClass;
+ $url = $className::url($path, $query, $absolute, $fragment);
return $url;
}
else {
*/
function &authenticate($name, $pass) {
if (isset(self::$ufClass)) {
- eval('$result =& ' . self::$ufClass . '::authenticate($name, $pass);');
+ $className = self::$ufClass;
+ $result =& $className::authenticate($name, $pass);
return $result;
}
else {