<commit_before><?php

/**
 * Renders the specified content block. Use in layout templates like this:
 *
 *     {! blocks/my-block-id !}
 */

global $user;

$id = (isset ($this->params[0])) ? $this->params[0] : false;
if (! $id) {
	if (User::is_valid () && $user->type == 'admin') {
		echo $tpl->render ('blocks/editable', (object) array ('id' => $id, 'locked' => false));
	}<commit_msg>Added support for dynamic block IDs in the same block position<commit_after><?php

/**
 * Renders the specified content block. Use in layout templates like this:
 *
 *     {! blocks/my-block-id !}
 *
 * You can also specify a dynamic ID value for your blocks so that a single
 * block position can refer to a dynamic number of blocks, like this:
 *
 *     {! blocks/index?id=[id] !}
 *
 * In the above example, `[id]` is replaced with the current page ID, so
 * that on each page, it will try to render a block in that position with
 * the same ID as the current page.
 *
 * See the API documentation for the Template class for more info on
 * `[expr]` style sub-expressions.
 */

global $user;

$id = (isset ($this->params[0])) ? $this->params[0] : (isset ($data['id'])) ? $data['id'] : false;
if (! $id) {
	if (User::is_valid () && $user->type == 'admin') {
		echo $tpl->render ('blocks/editable', (object) array ('id' => $id, 'locked' => false));
	}
{'fraction_non_alphanumeric': 0.1726457399103139, 'fraction_numerical': 0.0029895366218236174, 'mean_word_length': 3.6818181818181817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3602753', 'n_tokens_mistral': 434, 'n_tokens_neox': 433, 'n_words': 161}