Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

+192 -77
View File
@@ -1,27 +1,74 @@
function addAnotherRequirement()
{
requireIndex = parseInt(requireIndex) + 1;
// Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getApplications&secure_key=" + ipb.vars['md5_hash'] + "&i=" + requireIndex + "&name=requireApp";
url = url.replace( /&/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function ( t )
{
var newApp = ipb.templates['new_app_require'].evaluate({ index: requireIndex, dropdown: t.responseText });
if ( $('RequirementsContainer').down('tbody') )
{
$('RequirementsContainer').down('tbody').insert( newApp );
}
else
{
$('RequirementsContainer').insert( newApp );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
function removeRequirement( idToRemove )
{
idToRemove = parseInt(idToRemove);
if( $('requirementTitleRow_' + idToRemove ) != null )
{
$('requirementTitleRow_' + idToRemove ).remove();
}
if( $('requirementRow_' + idToRemove ) != null )
{
$('requirementRow_' + idToRemove ).remove();
}
}
function addAnotherFile()
{
elementIndex = parseInt(elementIndex) + 1;
var header = new Element( 'div', { 'class': 'tablesubheader' } );
header.update( ipb.lang['hookfilenumber'] + elementIndex );
var newFile = ipb.templates['new_hook_file'].evaluate({ index: elementIndex });
var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } );
list.addClassName( 'acp-form' );
list.addClassName( 'alternate_rows' );
$('fileTableContainer').insert( header );
$('fileTableContainer').insert( list );
var li1 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filename'] + "</label><input type='text' name='file[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li2 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_classname'] + "</label><input type='text' name='hook_classname[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li3 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filetype'] + "</label><select name='hook_type[" + elementIndex + "]' id='hook_type[" + elementIndex + "]' onchange='selectHookType(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='commandHooks'>" + ipb.lang['hook_filetype_action'] + "</option><option value='skinHooks'>" + ipb.lang['hook_filetype_skin'] + "</option><option value='templateHooks'>" + ipb.lang['hook_filetype_template'] + "</option><option value='dataHooks'>" + ipb.lang['hook_filetype_data'] + "</option><option value='libraryHooks'>" + ipb.lang['hook_filetype_library'] + "</option></select>" );
if ( $('fileTableContainer').down('tbody') )
{
$('fileTableContainer').down('tbody').insert( newFile );
}
else
{
$('fileTableContainer').insert( newFile );
}
}
$('fileTable_' + elementIndex).insert( li1 );
$('fileTable_' + elementIndex).insert( li2 );
$('fileTable_' + elementIndex).insert( li3 );
doStriping();
function removeFile( elementIndex )
{
elementIndex = parseInt(elementIndex);
if( $('fileRow_' + elementIndex ) != null )
{
$('fileRow_' + elementIndex ).remove();
}
}
function selectHookType( elementIndex )
@@ -63,7 +110,6 @@ function selectHookType( elementIndex )
$('tr_dataLocation[' + elementIndex + ']').remove();
}
if( $('tr_libApplication[' + elementIndex + ']') != null )
{
$('tr_libApplication[' + elementIndex + ']').remove();
@@ -81,9 +127,16 @@ function selectHookType( elementIndex )
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinGroup[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skingroup'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
var newRow = ipb.templates['hook_skinGroup'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
@@ -101,9 +154,16 @@ function selectHookType( elementIndex )
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_dataLocation[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_data_location'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
var newRow = ipb.templates['hook_dataLocation'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
@@ -111,9 +171,6 @@ function selectHookType( elementIndex )
}
else if( type == 'libraryHooks' )
{
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
$('fileTable_' + elementIndex).insert( li1 );
// Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
@@ -124,9 +181,17 @@ function selectHookType( elementIndex )
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_libApplication[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_application'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
var replace = { index: elementIndex, dropdown: t.responseText };
var newRow = ipb.templates['hook_classToOverload'].evaluate(replace) + ipb.templates['hook_libApplication'].evaluate(replace);
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
@@ -136,8 +201,16 @@ function selectHookType( elementIndex )
{
// Show the classToOverload field
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
$('fileTable_' + elementIndex).insert( li1 );
var newRow = ipb.templates['hook_classToOverload'].evaluate({ index: elementIndex });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
}
}
@@ -165,27 +238,38 @@ function getTemplatesForAdd( elementIndex )
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinFunction[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skinfunc'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
/* Got a type? */
if( type != '0' )
{
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
var newRow = ipb.templates['hook_skinFunction'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
}
function getTypeOfHook( elementIndex )
{
var type = $F('skinFunction[' + elementIndex + ']');
var template = $F('skinFunction[' + elementIndex + ']');
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
@@ -200,11 +284,21 @@ function getTypeOfHook( elementIndex )
{
$('tr_position[' + elementIndex + ']').remove();
}
li1 = new Element( 'li', { 'id': 'tr_type[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_temptype'] + "</label><select name='type[" + elementIndex + "]' id='type[" + elementIndex + "]' onchange='getHookIds(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='foreach'>foreach loop</option><option value='if'>if statement</option></select>" );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
/* Insert the new hook type row */
if ( template != '0' )
{
var newRow = ipb.templates['hook_pointTypes'].evaluate({ index: elementIndex });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
}
}
function getHookIds( elementIndex )
@@ -222,34 +316,46 @@ function getHookIds( elementIndex )
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_id[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_hookid'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
/* Got a type? */
if( type != '0' )
{
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
var newRow = ipb.templates['hook_pointIds'].evaluate({ index: elementIndex, dropdown: t.responseText });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
}
function getHookEntryPoints( elementIndex )
{
var type = $F('type[' + elementIndex + ']');
var type = $F('type[' + elementIndex + ']');
Debug.write( type );
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
var options = '';
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
if( type == 'foreach' )
{
@@ -267,9 +373,18 @@ function getHookEntryPoints( elementIndex )
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>";
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>";
}
var li1 = new Element( 'li', { 'id': 'tr_position[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_tempposi'] + "</label><select name='position[" + elementIndex + "]' id='position[" + elementIndex + "]'>" + options + "</select>" );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
/* Insert the new hook type row */
//if ( type != '0' )
//{
var newRow = ipb.templates['hook_pointLocation'].evaluate({ index: elementIndex, hookPoints: options });
if ( $('fileTable_' + elementIndex).down('tbody') )
{
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
}
else
{
$('fileTable_' + elementIndex).insert( newRow );
}
//}
}