function doExpressionTemplate ($data) {
// Do the replacement
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
- $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true) . {DQUOTE}";
+ $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true";
+
+ // Is 'value' set?
+ if (!empty($data['value'])) {
+ // Then include it as well
+ $replacer .= ", '" . $data['value'] . "'";
+ } // END - if
+
+ // Replacer is ready
+ $replacer .= ') . {DQUOTE}';
// Replace the code
$code = replaceExpressionCode($data, $replacer);
$content['task_created'] = generateDateTime($content['task_created'], 2);
// Do we have extension task?
- if ((isExtensionTask($content)) && (isExtensionProductive($content['infos']))) {
+ if (isExtensionTask($content)) {
// Load extension row template
$OUT .= loadTemplate('admin_overview_list_ext_rows', true, $content);
- } elseif ((isExtensionTask($content)) && (!isExtensionProductive($content['infos']))) {
- // Load extension row template
- $OUT .= loadTemplate('admin_overview_list_ext2_rows', true, $content);
} else {
// Load default row template
$OUT .= loadTemplate('admin_overview_list_rows', true, $content);
if (isGetRequestParameterSet('reg_ext')) {
// We are about to register a new extension
- $do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
+ $do = 'register';
+ $taskId = determineExtensionTaskId(getRequestParameter('reg_ext'));
+
// The id comes from task management and it is - of course - *not* the extension's name!
} elseif ((isFormSent('change')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// De-/activate extensions
));
// Do we have an extension task?
- if ((isExtensionTask($content)) && (isExtensionProductive($content['infos']))) {
+ if (isExtensionTask($content)) {
// Load extension row template
$OUT .= loadTemplate('admin_list_task_ext_rows', true, $content);
- } elseif ((isExtensionTask($content)) && (!isExtensionProductive($content['infos']))) {
- // Load extension row template
- $OUT .= loadTemplate('admin_list_task_ext2_rows', true, $content);
} else {
// Load default row template
$OUT .= loadTemplate('admin_list_task_rows', true, $content);
} // END - if
}
+// Helper function for extension registration link
+function doTemplateExtensionRegistrationLink ($template, $dummy, $ext_name) {
+ // Default is all productive
+ $OUT = '<a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&what=extensions&reg_ext=' . $ext_name . '%}">{--ADMIN_REGISTER_EXTENSION--}</a>';
+
+ // Is the given extension non-productive?
+ if (!isExtensionProductive($ext_name)) {
+ // Non-productive code
+ $OUT = '<em style="cursor:help" class="admin_note" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=' . $ext_name . '%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</em>';
+ } // END - if
+
+ // Return code
+ return $OUT;
+}
+
// Init color switch
function initTemplateColorSwitch ($template) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'INIT:' . $template);
// Normal-Mails
$result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
array($url_mid, $url_userid), __FILE__, __LINE__);
- $type = 'mailid'; $urlId = $url_mid;
+ $type = 'mailid';
+ $urlId = $url_mid;
} elseif ($url_bid > 0) {
// Bonus-Mail
$result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
array($url_bid, $url_userid), __FILE__, __LINE__);
- $type = 'bonusid'; $urlId = $url_bid;
+ $type = 'bonusid';
+ $urlId = $url_bid;
} else {
// Problem: No id entered
redirectToUrl('modules.php?module=index');
// Was that mail a valid one?
if ($isValid === true) {
// If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
- if (($time == '0') && ($payment > 0)) { $URL = getUrl(); $time = 1; }
+ if (($time == '0') && ($payment > 0)) {
+ $URL = getUrl();
+ $time = 1;
+ } // END - if
+
if (($time > 0) && (($payment > 0) || ($points > 0))) {
// Export data into constants for the template
$content = array(
if ($url_mid > 0) {
$result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
array($url_mid, $url_userid), __FILE__, __LINE__);
- $type = 'mailid'; $urlId = $url_mid;
+ $type = 'mailid';
+ $urlId = $url_mid;
} elseif ($url_bid > 0) {
$result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
array($url_bid, $url_userid), __FILE__, __LINE__);
- $type = 'bonusid'; $urlId = $url_bid;
+ $type = 'bonusid';
+ $urlId = $url_bid;
}
if (SQL_NUMROWS($result_main) == 1) {
<a name="ext_$content[ext_name]"></a>
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[id]%}" method="post">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[ext_name]%}" method="post">
<input type="submit" name="ok" class="admin_submit" value="{--ADMIN_REGISTER_EXTENSION--}" />
</form>
-<tr>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
- </td>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- {%pipe,generateAdminLink=$content[assigned_admin]%}
- </td>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- <em style="cursor:help" class="admin_note" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=$content[infos]%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</em>
- </td>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- {%pipe,fixEmptyContentToDashes=$content[infos]%}
- </td>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- $content[userid]
- </td>
- <td class="{%template,ColorSwitch%} bottom right" align="center">
- $content[task_type_msg]
- </td>
- <td class="{%template,ColorSwitch%} bottom" align="center">
- $content[task_created]
- </td>
-</tr>
+<!-- @DEPRECATED //-->
{%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
- <a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[id]%}">{--ADMIN_REGISTER_EXTENSION--}</a>
+ {%template,ExtensionRegistrationLink=$content[infos]%}
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
{%pipe,fixEmptyContentToDashes=$content[infos]%}
{%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
- <a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[id]%}">{--ADMIN_REGISTER_EXTENSION--}</a>
+ {%template,ExtensionRegistrationLink=$content[infos]%}
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
{%pipe,fixEmptyContentToDashes=$content[infos]%}