- Introduced new function capitalizeUnderscoreString(), this function does first
convert all dashes (-) into underscores (_) and then capitalizes all strings
parts. This function is self-cached to speedup things
- All ext-network templates rewritten which has a 'do' parameter, this parameter
identifies the form which should be processed by doNetworkProccessForm()
// Add non-empty parts
if (!empty($piece)) {
// Add it
- $functionName .= ucfirst(strtolower($piece));
+ $functionName .= capitalizeUnderscoreString($piece);
} // END - if
} // END - foreach
// Is the extension installed?
if (isExtensionInstalled($data['matches'][4][$data['key']])) {
// Construct call-back function name
- $functionName = 'getExtension' . ucfirst(strtolower($data['callback']));
+ $functionName = 'getExtension' . capitalizeUnderscoreString($data['callback']);
// Construct call of the function
$replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . {DQUOTE}";
} // END - if
// Construct call-back function name for the command
- $commandFunction = 'doExpression' . ucfirst(strtolower($cmd));
+ $commandFunction = 'doExpression' . capitalizeUnderscoreString($cmd);
// Is this function there?
if (function_exists($commandFunction)) {
if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
if (!isset($trace['line'])) $trace['line'] = __LINE__;
if (!isset($trace['args'])) $trace['args'] = array();
- $backtrace .= '<li class="debug_list"><span class="backtrace_file">' . basename($trace['file']) . '</span>:' . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'] . '(' . count($trace['args']) . ')</span></li>';
+ $backtrace .= '<li class="debug_list"><span class="backtrace_file">' . basename($trace['file']) . '</span>:' . $trace['line'] . ', <span class="backtrace_function">' . $trace['function'] . '(' . count($trace['args']) . ')</span></li>';
} // END - foreach
// Close it
return $userid;
}
+// Capitalizes a string with underscores, e.g.: some_foo_string will become SomeFooString
+// Note: This function is cached
+function capitalizeUnderscoreString ($str) {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$str])) {
+ // Init target string
+ $capitalized = '';
+
+ // Explode it with the underscore, but rewrite dashes to underscore before
+ $strArray = explode('_', str_replace('-', '_', $str));
+
+ // "Walk" through all elements and make them lower-case but first upper-case
+ foreach ($strArray as $part) {
+ // Capitalize the string part
+ $capitalized .= ucfirst(strtolower($part));
+ } // END - foreach
+
+ // Store the converted string in cache array
+ $GLOBALS[__FUNCTION__][$str] = $capitalized;
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$str];
+}
+
//-----------------------------------------------------------------------------
// Automatically re-created functions, all taken from user comments on www.php.net
//-----------------------------------------------------------------------------
}
// Create function name
- $functionName = sprintf("doAdminNetworkProcess%sForm", ucfirst(strtolower(getRequestParameter('do'))));
+ $functionName = sprintf("doAdminNetworkProcess%sForm", capitalizeUnderscoreString(getRequestParameter('do')));
// Is the function valid?
if (!function_exists($functionName)) {
//------------------------------------------------------------------------------
// Callback function to add new network
-function doAdminNetworkProcessAddnetworkForm () {
+function doAdminNetworkProcessAddNetworkForm () {
// We can say here, the form is sent, so check if the network is already added
if (isNetworkNameValid(postRequestParameter('network_short_name'))) {
// Already there
}
// Displays selected networks for editing
-function doAdminNetworkProcessHandlenetworkForm () {
+function doAdminNetworkProcessHandleNetworkForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// Something has been selected, so start displaying one by one
}
// Handle network type form
-function doAdminNetworkProcessHandlenetworktypeForm () {
+function doAdminNetworkProcessHandleNetworkTypeForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// Load network data
}
// Handle network request parameter form
-function doAdminNetworkProcessHandlerequestparamsForm () {
+function doAdminNetworkProcessHandleRequestParamsForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// Init cache array
}
// Changes given networks
-function doAdminNetworkProcessChangenetworkForm () {
+function doAdminNetworkProcessChangeNetworkForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
}
// Removes given networks
-function doAdminNetworkProcessRemovenetworkForm () {
+function doAdminNetworkProcessRemoveNetworkForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
}
// Add a network type handler if not yet found
-function doAdminNetworkProcessAddnetworktypeForm () {
+function doAdminNetworkProcessAddNetworkTypeForm () {
// Is the network type handle already used with given network?
if (isNetworkTypeHandleValid(postRequestParameter('network_type_handle'), getRequestParameter('network'))) {
// Already added
}
// Changes given network type handlers
-function doAdminNetworkProcessChangenetworktypeForm () {
+function doAdminNetworkProcessChangeNetworkTypeForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
}
// Changes given network request parameters
-function doAdminNetworkProcessChangenetworkparamForm () {
+function doAdminNetworkProcessChangeNetworkParamForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
}
// Removes given network type handlers
-function doAdminNetworkProcessRemovenetworktypeForm () {
+function doAdminNetworkProcessRemoveNetworkTypeForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
}
// Removes given network request parameters
-function doAdminNetworkProcessRemovenetworkparamForm () {
+function doAdminNetworkProcessRemoveNetworkParamForm () {
// Do we have selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
}
// Adds a request parameter to given network and type
-function doAdminNetworkProcessAddnetworkparamForm () {
+function doAdminNetworkProcessAddNetworkParamForm () {
// Is the request parameter already used with given network?
if (isNetworkRequestParameterValid(postRequestParameter('request_param_key'), postRequestParameter('network_type_id'), getRequestParameter('network'))) {
// Already added
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=addnetwork%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=add_network%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td class="admin_title bottom" colspan="2" align="center">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&do=addnetworkparam&network={%pipe,getRequestParameter=network%}&network_type={%pipe,getRequestParameter=network_type%}%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_api_translation&do=add_network_api_translation&network={%pipe,getRequestParameter=network%}&network_type={%pipe,getRequestParameter=network_type%}%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td class="admin_title bottom" colspan="2" align="center">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&do=addnetworkparam&network={%pipe,getRequestParameter=network%}%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&do=add_network_param&network={%pipe,getRequestParameter=network%}%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td class="admin_title bottom" colspan="2" align="center">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&do=addnetworktype&network={%pipe,getRequestParameter=network%}%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&do=add_network_type&network={%pipe,getRequestParameter=network%}%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td class="admin_title bottom" colspan="2" align="center">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=removenetworkparam%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=remove_network_param%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="2">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=removenetworktype%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=remove_network_type%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="2">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=removenetwork%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=remove_network%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="4">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=changenetworkparam%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=change_network_param%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="2">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=changenetworktype%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=change_network_type%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="2">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=changenetwork%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=change_network%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td align="center" class="admin_title bottom" height="25" colspan="4">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=handlerequestparams%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_params&network={%pipe,getRequestParameter=network%}&do=handle_request_params%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td colspan="5" align="center" class="admin_title bottom">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=handlenetworktype%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_network_types&network={%pipe,getRequestParameter=network%}&do=handle_network_type%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td colspan="5" align="center" class="admin_title bottom">
<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=handlenetwork%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_networks&do=handle_network%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td height="25" colspan="3" class="header_column bottom right seperator"> </td>