* -------------------------------------------------------------------- *
* Kurzbeschreibung : Standart-Aufgaben-Management ausgeben *
* -------------------------------------------------------------------- *
- * $Revision:: 856 $ *
- * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ *
+ * $Revision:: $ *
+ * $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
- * $Author:: stelzi $ *
+ * $Author:: $ *
* Needs to be in all Files and every File needs "svn propset *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
// We currently don't want to install an extension so let's find out if we need...
$EXT_LOAD_MODE = "register";
- $JOBS_DONE = true;
+ $jobsDone = true;
// Open the extension directory
- $handle = opendir(constant('PATH')."inc/extensions/") or mxchange_die("Cannot read extension directory!");
- while ($file = readdir($handle)) {
+ $extensionList = GET_DIR_AS_ARRAY("inc/extensions/", "ext-", false, false);
+ foreach ($extensionList as $file) {
// Is this file an extension?
if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
//* DEBUG: */ echo $file."<br />\n";
} // END - if
}
} // END - if
- } // END - while
-
- // Close directory handle
- closedir($handle);
+ } // END - foreach
// At last - but not least - check for own and new unassigned tasks...
$result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
if (SQL_NUMROWS($result_tasks) > 0) {
// New jobs found!
- $JOBS_DONE = false;
+ $jobsDone = false;
} // END - if
// Free the result
SQL_FREERESULT($result);
// Return status
- return $JOBS_DONE;
+ return $jobsDone;
}
// Outputs selected tasks
function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
- global $NOTES;
if ((isset($POST['assign'])) && (count($POST['task']) > 0)) {
// Assign / do tasks
$OUT = ""; $SW = 2;
array(GET_CURRENT_ADMIN_ID(), bigintval($tid)), __FILE__, __LINE__);
} // END - if
- $ADD = "";
+ $add = "";
if ($type == "SUPPORT_MEMBER") {
$mode = substr($text, 0, strpos($text, ":"));
$text = substr($text, strpos($text, ":") + 1);
- $ADD = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>".$mode."</strong></li>";
+ $add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>".$mode."</strong></li>";
} // END - if
if ($uid > 0) {
if (SQL_NUMROWS($result_user) == 1) {
list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
SQL_FREERESULT($result_user);
- $ADD = "<li>{--ADMIN_MEMBER_UID--}: <strong>".ADMIN_USER_PROFILE_LINK($uid)." (<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</a>)</strong></li>";
+ $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".ADMIN_USER_PROFILE_LINK($uid)." (<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</a>)</strong></li>";
} // END - if
} // END - if
$ext_name = substr($subj, 1, strpos($subj, ":") - 1);
if ($type == "EXTENSION") {
// Load SQL commands for registering
- SET_SQLS(EXTENSION_REGISTER($ext_name, $id, true));
+ REGISTER_EXTENSION($ext_name, $id, true);
// Add notes to text
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
// Set title
$title = getMessage('ADMIN_SQLS_EXECUTED_ON_REGISTER');
EXTENSION_UPDATE($ext_name, $ext_ver, true);
// Add notes to text
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
// Set title
$title = getMessage('ADMIN_SQLS_EXECUTED_ON_UPDATE');
} else {
// Run SQL commands in dry mode but only return the notes
EXTENSION_UPDATE($ext_name, $ext_ver, true);
- $text .= $NOTES;
+ $text .= EXT_GET_NOTES();
}
// Prepare array for the template
$content = array(
'sw' => $SW,
'subj' => $subj,
- 'add' => $ADD,
+ 'add' => $add,
'text' => $text,
'created' => MAKE_DATETIME($created, "1"),
'extension' => $ext_name
{
default: // @TODO Unknown support mode
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction!", $mode));
- $OUT .= "<div class=\"admin_failed medium\">".ADMIN_UNKNOWN_SUPPORT_MODE_1.$mode.ADMIN_UNKNOWN_SUPPORT_MODE_2."</div>\n";
+ $OUT .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_SUPPORT_MODE'), $mode)."</div>\n";
break;
}
break;
default: // Unknown task type
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $type));
- $OUT .= "<div class=\"admin_failed medium\">".ADMIN_UNKNOWN_TASK_TYPE_1.$type.ADMIN_UNKNOWN_TASK_TYPE_2.$id.ADMIN_UNKNOWN_TASK_TYPE_3."</div>\n";
+ $OUT .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id)."</div>\n";
break;
}
$OUT .= " </td>
} // END - if
// There are uncompleted jobs!
- // @TODO Rewrite this to one template and use $OUT = ...
- LOAD_TEMPLATE("admin_overview_header");
$OUT = ""; $SW = 2;
while ($content = SQL_FETCHARRAY($result_tasks)) {
// Init infos
// Do we have extension task?
if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) {
// Load extension row template
- // @TODO Rewrite this to $OUT .= ..., true, ...
- LOAD_TEMPLATE("admin_overview_list_ext_rows", false, $content);
+ $OUT .= LOAD_TEMPLATE("admin_overview_list_ext_rows", true, $content);
} else {
// Load default row template
- // @TODO Rewrite this to $OUT .= ..., true, ...
- LOAD_TEMPLATE("admin_overview_list_rows", false, $content);
+ $OUT .= LOAD_TEMPLATE("admin_overview_list_rows", true, $content);
}
// Switch color
SQL_FREERESULT($result_tasks);
// Load footer template
- LOAD_TEMPLATE("admin_overview_footer");
+ LOAD_TEMPLATE("admin_overview_table", false, $OUT);
}
}
//