Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/categories/categories_item.php
Show All 22 Lines | |||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function buildParentBasedFields() | public function buildParentBasedFields() | ||||
{ | { | ||||
static $parent_cache = Array ( | static $parent_cache = Array ( | ||||
0 => Array ('ParentPath' => '|', 'NamedParentPath' => '', 'CachedTemplate' => ''), | 0 => Array ('ParentPath' => '|', 'NamedParentPath' => '', 'CachedTemplate' => ''), | ||||
); | ); | ||||
/** @var kMultiLanguageHelper $ml_helper */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | $ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | ||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
$languages = $ml_helper->getLanguages(); | $languages = $ml_helper->getLanguages(); | ||||
$parent_id = $this->GetDBField('ParentId'); | $parent_id = $this->GetDBField('ParentId'); | ||||
if ( !isset($parent_cache[$parent_id]) ) { | if ( !isset($parent_cache[$parent_id]) ) { | ||||
$select_fields = Array ('ParentPath', 'NamedParentPath', 'Template', 'CachedTemplate'); | $select_fields = Array ('ParentPath', 'NamedParentPath', 'Template', 'CachedTemplate'); | ||||
foreach ($languages as $language_id) { | foreach ($languages as $language_id) { | ||||
Show All 36 Lines | |||||
* replace not allowed symbols with "_" chars + remove duplicate "_" chars in result | * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result | ||||
* | * | ||||
* @param string $string | * @param string $string | ||||
* @return string | * @return string | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function stripDisallowed($string) | protected function stripDisallowed($string) | ||||
{ | { | ||||
/** @var kFilenamesHelper $filenames_helper */ | |||||
$filenames_helper = $this->Application->recallObject('FilenamesHelper'); | $filenames_helper = $this->Application->recallObject('FilenamesHelper'); | ||||
/* @var $filenames_helper kFilenamesHelper */ | |||||
$string = $filenames_helper->replaceSequences($string); | $string = $filenames_helper->replaceSequences($string); | ||||
return $this->checkAutoFilename($string); | return $this->checkAutoFilename($string); | ||||
} | } | ||||
public function checkFilename() | public function checkFilename() | ||||
{ | { | ||||
Show All 14 Lines | |||||
{ | { | ||||
static $current_theme = null; | static $current_theme = null; | ||||
if (!$filename) { | if (!$filename) { | ||||
return $filename; | return $filename; | ||||
} | } | ||||
if (!isset($current_theme)) { | if (!isset($current_theme)) { | ||||
/** @var kThemesHelper $themes_helper */ | |||||
$themes_helper = $this->Application->recallObject('ThemesHelper'); | $themes_helper = $this->Application->recallObject('ThemesHelper'); | ||||
/* @var $themes_helper kThemesHelper */ | |||||
$current_theme = (int)$themes_helper->getCurrentThemeId(); | $current_theme = (int)$themes_helper->getCurrentThemeId(); | ||||
} | } | ||||
$escape_char = $this->Application->ConfigValue('FilenameSpecialCharReplacement'); | $escape_char = $this->Application->ConfigValue('FilenameSpecialCharReplacement'); | ||||
$item_id = !$this->GetID() ? 0 : $this->GetID(); | $item_id = !$this->GetID() ? 0 : $this->GetID(); | ||||
$item_theme = $this->GetDBField('ThemeId'); | $item_theme = $this->GetDBField('ThemeId'); | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function generateFilename() | public function generateFilename() | ||||
{ | { | ||||
if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) { | if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) { | ||||
return ; | return ; | ||||
} | } | ||||
/** @var kMultiLanguage $ml_formatter */ | |||||
$ml_formatter = $this->Application->recallObject('kMultiLanguage'); | $ml_formatter = $this->Application->recallObject('kMultiLanguage'); | ||||
/* @var $ml_formatter kMultiLanguage */ | |||||
$name = $this->stripDisallowed( $this->GetDBField($ml_formatter->LangFieldName('Name', true)) ); | $name = $this->stripDisallowed( $this->GetDBField($ml_formatter->LangFieldName('Name', true)) ); | ||||
if ( $name != $this->GetDBField('Filename') ) { | if ( $name != $this->GetDBField('Filename') ) { | ||||
$this->SetDBField('Filename', $name); | $this->SetDBField('Filename', $name); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
$res = $this->Conn->GetOne($query); | $res = $this->Conn->GetOne($query); | ||||
}*/ | }*/ | ||||
$original_checked = true; | $original_checked = true; | ||||
} while ($res !== false); | } while ($res !== false); | ||||
$this->SetDBField($title_field, $new_name); | $this->SetDBField($title_field, $new_name); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |