Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r11319 -r11368 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11319) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11368) @@ -2304,6 +2304,32 @@ { return $this->Application->getUnitOption($this->Prefix, $params['name']); } + + /** + * Returns list of allowed toolbar buttons or false, when all is allowed + * + * @param Array $params + * @return string + */ + function VisibleToolbarButtons($params) + { + $preset_name = $params['title_preset']; + $title_presets = $this->Application->getUnitOption($this->Prefix, 'TitlePresets'); + + if (!array_key_exists($preset_name, $title_presets)) { + trigger_error('Title preset not specified or missing (in tag "' . $this->getPrefixSpecial() . ':' . __METHOD__ . '")', E_USER_WARNING); + return false; + } + + $preset_info = $title_presets[$preset_name]; + if (!array_key_exists('toolbar_buttons', $preset_info) || !is_array($preset_info['toolbar_buttons'])) { + return false; + } + + $toolbar_buttons = array_map('addslashes', $preset_info['toolbar_buttons']); + + return $toolbar_buttons ? "'" . implode("', '", $toolbar_buttons) . "'" : 'false'; + } } ?> \ No newline at end of file