<commit_before><div id="mytiki">
 <div class="titlebar">{tr}My {if $smarty.request.type}{$smarty.request.type}{/if}s{/tr}</div>
 <div id='mypageeditdivparking' style='display: none;'>
  <div class="mypage_configure" id='mypageeditdiv' style='border: padding-left: 7px; padding-right: 7px;'>
   <input id='mypageedit_id' type='hidden' value=''>
   <table class="normal">
    <tr>
     <th>{tr}Name{/tr}</th>
     <td>
      <input id='mypageedit_name' type='text' name='name' value='' style='width: 100%' onkeyup='isNameFree();' />
      <input id='mypageedit_name_orig' type='hidden' name='name' value='' />
      <div id='mypageedit_name_unique' style='color: red;'></div>
     </td>
    </tr>

    <tr>
     <th>{tr}Description{/tr}</th>
     <td><textarea id='mypageedit_description' name='description' style='width: 100%; height: 64px;'></textarea></td>
    </tr>

    <tr id='mypageedit_tr_type' {if $id_types}style='display: none;'{/if}>
     <th>{tr}Object Type{/tr}</th>
     <td>
      <select id="mypageedit_type" onchange='mypageTypeChange(this.value);'>
      {foreach from=$mptypes item=mptype}
       <option value="{$mptype.id|escape}">{$mptype.name|escape}</option>
      {/foreach}
     </select>
     </td>
    </tr>
    {if $feature_categories eq "y"}
     <tr><th>{tr}Categorize{/tr}</th><td id='mypageedit_categorize_tpl'>{$mypageedit_categorize_tpl}</td></tr>
    {/if}
    <tr id='mypageedit_tr_dimensions' style='display: none;'>
     <th>{tr}Dimensions{/tr}</th>
     <td>
      <input id='mypageedit_width' type='text' name='width' value='' style='width: 40px'> x 
      <input id='mypageedit_height' type='text' name='height' value='' style='width: 40px'> ({tr}pixels{/tr})
     </td>
    </tr>

    <tr id='mypageedit_tr_template' style='display: none;'>
     <th>{tr}Template{/tr}</th>
     <td>
      <select id='mypageedit_template'>
       <option value='0'>No template</option>
      </select>
     </td>
    </tr>

   </table>

   <form id='form_mypageedit_typeconf'><div id='mypageedit_typeconf'></div></form>

   <div style='text-align: right'>
    <input type='button' value='Cancel' onclick='closeMypageEdit();'>
    <input id='mypageedit_submit' type='button' value='Modify' onclick='saveMypageEdit();'>
   </div>
  </div>
 </div>

{if $mypage_admin}
{tr}view{/tr}: <select onchange='mypage_change_type(this.value);'>
  <option value=''>{tr}all types{/tr}</option>
 {foreach from=$mptypes item=mptype}
  <option value='{$mptype.name|escape}' {if $id_types==$mptype.id}selected{/if}>{$mptype.name|escape}</option>
 {/foreach}
</select> | 
{/if}
<input type='button' value='Create' onclick='showMypageEdit(0);'>

<table class="normal">
<tr>
 {foreach from=$mp_columns item=col}
  <th class="heading" {if $col.hidden}style='display: none;'{/if}>{if $col.header_tpl}{eval var=$col.header_tpl}{else}{tr}{$col.title}{/tr}{/if}</th>
 {/foreach}
</tr>

{cycle values="odd,even" print=false}
{foreach from=$mypages item=mypage}
<tr class="{cycle}">
 {foreach from=$mp_columns item=col}
  <td {if $col.hidden}style='display: none;'{/if}>{eval var=$col.content_tpl}</td>
 {/foreach}
</tr>
{/foreach}
</table>
<select id='mypage_page_select' onchange='changepage();'>
 {foreach from=$pagesnum key=k item=v}
 <option value='{$k}'{if $showpage == $k} selected{/if}>{$v} / {$pcount}</option>
 {/foreach}
</select>
</div>
{literal}
<script type="text/javascript">
function changepage() {
	var p=$('mypage_page_select').value;
	var url='?showpage='+p;
	{/literal}{if $mypage_admin}url+='&admin';{/if}{literal}
	{/literal}{if $mptype_name}url+='&type={$mptype_name|escape:javascript}';{/if}{literal}
	window.location=url;	
}

function mypage_change_type(name) {
	var url='?showpage=0';
	if (name != '')
		url+='&type='+escape(name);
	{/literal}{if $mypage_admin}url+='&admin';{/if}{literal}
	window.location=url;
}

var curmodal=0;

function initMypageEdit() {
}

function showMypageEdit(id) {
	curmodal=new Windoo({
		"modal": true,
		"width": 600,
		"height": 550,
		"container": false,
		"theme": "mypage"
	}).adopt($('mypageeditdiv'));

	if (id > 0) {
		xajax_mypage_fillinfos(id);
		$('mypageedit_submit').value='{/literal}{tr}Modify{/tr}{literal}';
		{/literal}{if $id_types}{literal}
		  curmodal.setTitle({/literal}"{tr}Edit{/tr} "+mptypes[{$id_types}].name{literal});
		{/literal}{else}{literal}
		  curmodal.setTitle({/literal}"{tr}Edit{/tr}..."{literal});
		{/literal}{/if}{literal}
		$('mypageedit_template').selectedIndex=0;
	} else {
		$('mypageedit_id').value=0;
		$('mypageedit_name').value='';
		$('mypageedit_name_orig').value='';
		$('mypageedit_description').value='';
		{/literal}{if $id_types}{literal}
		  curmodal.setTitle({/literal}"{tr}New{/tr} "+mptypes[{$id_types}].name{literal});
		  $('mypageedit_type').value={/literal}{$id_types}{literal};
		  xajax_mypage_fillinfos(0, {/literal}{$id_types}{literal});
		{/literal}{else}{literal}
		  curmodal.setTitle({/literal}"{tr}New{/tr}..."{literal});
		  $('mypageedit_type').selectedIndex=0;
		  xajax_mypage_fillinfos(0, $('mypageedit_type').value);
		{/literal}{/if}{literal}
		$('mypageedit_width').value=mptypes[$('mypageedit_type').value].def_width;
		$('mypageedit_height').value=mptypes[$('mypageedit_type').value].def_height;
		$('mypageedit_submit').value='{/literal}{tr}Create{/tr}{literal}';
		mypageTypeChange($('mypageedit_type').value);
	}

	curmodal.show();
}

function closeMypageEdit() {
	$('mypageeditdivparking').adopt($('mypageeditdiv'));
	curmodal.close();
	curmodal=null;<commit_msg>[FIX] mypage/mypages: correct a bug that was making button "create" not working anymore if a previous try was canceled. Also made the dialog smaller<commit_after><div id="mytiki">
 <div class="titlebar">{tr}My {if $smarty.request.type}{$smarty.request.type}{/if}s{/tr}</div>
 <div id='mypageeditdivparking' style='display: none;'>
  <div class="mypage_configure" id='mypageeditdiv' style='border: padding-left: 7px; padding-right: 7px;'>
   <input id='mypageedit_id' type='hidden' value=''>
   <table class="normal">
    <tr>
     <th>{tr}Name{/tr}</th>
     <td>
      <input id='mypageedit_name' type='text' name='name' value='' style='width: 100%' onkeyup='isNameFree();' />
      <input id='mypageedit_name_orig' type='hidden' name='name' value='' />
      <div id='mypageedit_name_unique' style='color: red;'></div>
     </td>
    </tr>

    <tr>
     <th>{tr}Description{/tr}</th>
     <td><textarea id='mypageedit_description' name='description' style='width: 100%; height: 64px;'></textarea></td>
    </tr>

    <tr id='mypageedit_tr_type' {if $id_types}style='display: none;'{/if}>
     <th>{tr}Object Type{/tr}</th>
     <td>
      <select id="mypageedit_type" onchange='mypageTypeChange(this.value);'>
      {foreach from=$mptypes item=mptype}
       <option value="{$mptype.id|escape}">{$mptype.name|escape}</option>
      {/foreach}
     </select>
     </td>
    </tr>
    {if $feature_categories eq "y"}
     <tr><th>{tr}Categorize{/tr}</th><td id='mypageedit_categorize_tpl'>{$mypageedit_categorize_tpl}</td></tr>
    {/if}
    <tr id='mypageedit_tr_dimensions' style='display: none;'>
     <th>{tr}Dimensions{/tr}</th>
     <td>
      <input id='mypageedit_width' type='text' name='width' value='' style='width: 40px'> x 
      <input id='mypageedit_height' type='text' name='height' value='' style='width: 40px'> ({tr}pixels{/tr})
     </td>
    </tr>

    <tr id='mypageedit_tr_template' style='display: none;'>
     <th>{tr}Template{/tr}</th>
     <td>
      <select id='mypageedit_template'>
       <option value='0'>No template</option>
      </select>
     </td>
    </tr>

   </table>

   <form id='form_mypageedit_typeconf'><div id='mypageedit_typeconf'></div></form>

   <div style='text-align: right'>
    <input type='button' value='Cancel' onclick='closeMypageEdit();'>
    <input id='mypageedit_submit' type='button' value='Modify' onclick='saveMypageEdit();'>
   </div>
  </div>
 </div>

{if $mypage_admin}
{tr}view{/tr}: <select onchange='mypage_change_type(this.value);'>
  <option value=''>{tr}all types{/tr}</option>
 {foreach from=$mptypes item=mptype}
  <option value='{$mptype.name|escape}' {if $id_types==$mptype.id}selected{/if}>{$mptype.name|escape}</option>
 {/foreach}
</select> | 
{/if}
<input type='button' value='Create' onclick='showMypageEdit(0);'>

<table class="normal">
<tr>
 {foreach from=$mp_columns item=col}
  <th class="heading" {if $col.hidden}style='display: none;'{/if}>{if $col.header_tpl}{eval var=$col.header_tpl}{else}{tr}{$col.title}{/tr}{/if}</th>
 {/foreach}
</tr>

{cycle values="odd,even" print=false}
{foreach from=$mypages item=mypage}
<tr class="{cycle}">
 {foreach from=$mp_columns item=col}
  <td {if $col.hidden}style='display: none;'{/if}>{eval var=$col.content_tpl}</td>
 {/foreach}
</tr>
{/foreach}
</table>
<select id='mypage_page_select' onchange='changepage();'>
 {foreach from=$pagesnum key=k item=v}
 <option value='{$k}'{if $showpage == $k} selected{/if}>{$v} / {$pcount}</option>
 {/foreach}
</select>
</div>
{literal}
<script type="text/javascript">
function changepage() {
	var p=$('mypage_page_select').value;
	var url='?showpage='+p;
	{/literal}{if $mypage_admin}url+='&admin';{/if}{literal}
	{/literal}{if $mptype_name}url+='&type={$mptype_name|escape:javascript}';{/if}{literal}
	window.location=url;	
}

function mypage_change_type(name) {
	var url='?showpage=0';
	if (name != '')
		url+='&type='+escape(name);
	{/literal}{if $mypage_admin}url+='&admin';{/if}{literal}
	window.location=url;
}

var curmodal=0;

function initMypageEdit() {
}

function showMypageEdit(id) {
	curmodal=new Windoo({
		"modal": true,
		"width": 600,
		"height": 430,
		"container": false,
		"theme": "mypage"
	}).adopt($('mypageeditdiv'));

	if (id > 0) {
		xajax_mypage_fillinfos(id);
		$('mypageedit_submit').value='{/literal}{tr}Modify{/tr}{literal}';
		{/literal}{if $id_types}{literal}
		  curmodal.setTitle({/literal}"{tr}Edit{/tr} "+mptypes[{$id_types}].name{literal});
		{/literal}{else}{literal}
		  curmodal.setTitle({/literal}"{tr}Edit{/tr}..."{literal});
		{/literal}{/if}{literal}
		$('mypageedit_template').selectedIndex=0;
	} else {
		$('mypageedit_id').value=0;
		$('mypageedit_name').value='';
		$('mypageedit_name_orig').value='';
		$('mypageedit_description').value='';
		{/literal}{if $id_types}{literal}
		  curmodal.setTitle({/literal}"{tr}New{/tr} "+mptypes[{$id_types}].name{literal});
		  $('mypageedit_type').value={/literal}{$id_types}{literal};
		  xajax_mypage_fillinfos(0, {/literal}{$id_types}{literal});
		{/literal}{else}{literal}
		  curmodal.setTitle({/literal}"{tr}New{/tr}..."{literal});
		  $('mypageedit_type').selectedIndex=0;
		  xajax_mypage_fillinfos(0, $('mypageedit_type').value);
		{/literal}{/if}{literal}
		$('mypageedit_width').value=mptypes[$('mypageedit_type').value].def_width;
		$('mypageedit_height').value=mptypes[$('mypageedit_type').value].def_height;
		$('mypageedit_submit').value='{/literal}{tr}Create{/tr}{literal}';
		mypageTypeChange($('mypageedit_type').value);
	}

	curmodal.addEvent('onClose', function() {
		$('mypageeditdivparking').adopt($('mypageeditdiv'));
		curmodal=null;
	});
	curmodal.show();
}

function closeMypageEdit() {
	curmodal.close();
{'fraction_non_alphanumeric': 0.22401001162063108, 'fraction_numerical': 0.0053633681952266025, 'mean_word_length': 5.523615160349855, 'pattern_counts': {'":': 10, '<': 189, '<?xml version=': 0, '>': 191, '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': '1859943', 'n_tokens_mistral': 4507, 'n_tokens_neox': 4246, 'n_words': 618}