Changeset View
Changeset View
Standalone View
Standalone View
core/units/configuration/configuration_tag_processor.php
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | |||||
function ConfigValue($params) | function ConfigValue($params) | ||||
{ | { | ||||
return $this->Application->ConfigValue($params['name']); | return $this->Application->ConfigValue($params['name']); | ||||
} | } | ||||
function IsRequired($params) | function IsRequired($params) | ||||
{ | { | ||||
/** @var kDBItem $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | |||||
$field = $params['field']; | $field = $params['field']; | ||||
$field_options = $object->GetFieldOptions($field); | $field_options = $object->GetFieldOptions($field); | ||||
if ( $field == 'VariableValue' ) { | if ( $field == 'VariableValue' ) { | ||||
$custom_options = $object->GetDBField('Validation'); | $custom_options = $object->GetDBField('Validation'); | ||||
if ( $custom_options ) { | if ( $custom_options ) { | ||||
$field_options = array_merge($field_options, unserialize($custom_options)); | $field_options = array_merge($field_options, unserialize($custom_options)); | ||||
} | } | ||||
} | } | ||||
return isset($field_options['required']) && $field_options['required']; | return isset($field_options['required']) && $field_options['required']; | ||||
} | } | ||||
function Error($params) | function Error($params) | ||||
{ | { | ||||
/** @var kDBList $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBList */ | |||||
if ( !($object instanceof kDBList) ) { | if ( !($object instanceof kDBList) ) { | ||||
return parent::Error($params); | return parent::Error($params); | ||||
} | } | ||||
$field = $object->GetDBField($params['id_field']); | $field = $object->GetDBField($params['id_field']); | ||||
$errors = $this->Application->GetVar('errors_' . $this->getPrefixSpecial(), Array ()); | $errors = $this->Application->GetVar('errors_' . $this->getPrefixSpecial(), Array ()); | ||||
return array_key_exists($field, $errors) ? $errors[$field] : ''; | return array_key_exists($field, $errors) ? $errors[$field] : ''; | ||||
} | } | ||||
/** | /** | ||||
* Allows to show category path of selected module | * Allows to show category path of selected module | ||||
* | * | ||||
* @param Array $params | * @param Array $params | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
function CategoryPath($params) | function CategoryPath($params) | ||||
{ | { | ||||
if (!isset($params['cat_id'])) { | if (!isset($params['cat_id'])) { | ||||
$params['cat_id'] = $this->ModuleRootCategory( Array() ); | $params['cat_id'] = $this->ModuleRootCategory( Array() ); | ||||
} | } | ||||
/** @var kNavigationBar $navigation_bar */ | |||||
$navigation_bar = $this->Application->recallObject('kNavigationBar'); | $navigation_bar = $this->Application->recallObject('kNavigationBar'); | ||||
/* @var $navigation_bar kNavigationBar */ | |||||
return $navigation_bar->build($params); | return $navigation_bar->build($params); | ||||
} | } | ||||
/** | /** | ||||
* Shows edit warning in case if module root category changed but not saved | * Shows edit warning in case if module root category changed but not saved | ||||
* | * | ||||
* @param Array $params | * @param Array $params | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
* Returns system setting editing link | * Returns system setting editing link | ||||
* | * | ||||
* @param Array $params | * @param Array $params | ||||
* @return string | * @return string | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function ItemEditLink($params) | protected function ItemEditLink($params) | ||||
{ | { | ||||
/** @var kDBItem $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | |||||
$params['m_opener'] = 'd'; | $params['m_opener'] = 'd'; | ||||
$params[$object->Prefix . '_mode'] = 't'; | $params[$object->Prefix . '_mode'] = 't'; | ||||
$params[$object->Prefix . '_event'] = 'OnEdit'; | $params[$object->Prefix . '_event'] = 'OnEdit'; | ||||
$params[$object->Prefix . '_id'] = $object->GetID(); | $params[$object->Prefix . '_id'] = $object->GetID(); | ||||
$params['pass'] = 'all,' . $object->Prefix; | $params['pass'] = 'all,' . $object->Prefix; | ||||
return $this->Application->ProcessParsedTag('m', 'Link', $params); | return $this->Application->ProcessParsedTag('m', 'Link', $params); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |