Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,27 +2,18 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-28 15:18:16 +0100 (Fri, 28 Oct 2005) $
|
||||
| > $Revision: 67 $
|
||||
| > $Author: bfarber $
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Task Manager
|
||||
@@ -36,7 +27,7 @@
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -84,31 +75,20 @@ class ad_task_manager
|
||||
// Continue
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ñîäåðæèò âñå âàøè óñòàíîâëåííûå çàäà÷è.<br />Ïîæàëóéñòà, ó÷òèòå, ÷òî âñå ýòè çàäà÷è çàïóñêàþòñÿ òîëüêî òîãäà, êîãäà âàø ôîðóì äîñòóïåí ïîñåòèòåëÿì, ñëåäóþùèé çàïóñê ïðîèñõîäèò òîëüêî ïðè âûçîâå ôîðóìà.";
|
||||
$this->ipsclass->admin->page_title = "Óïðàâëåíèå çàäà÷àìè";
|
||||
$this->ipsclass->admin->page_detail = "The task manager contains all your scheduled tasks.<br />Please note that as these tasks are run when the board is accessed, the next run time is to be used as a guide only and depends on the traffic your board gets.";
|
||||
$this->ipsclass->admin->page_title = "Task Manager";
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Óïðàâëåíèå çàäà÷àìè' );
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Task Manager Home' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Using "do"?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->input['j_do'] )
|
||||
if ( isset($this->ipsclass->input['j_do']) AND $this->ipsclass->input['j_do'] )
|
||||
{
|
||||
$this->ipsclass->input['code'] = $this->ipsclass->input['j_do'];
|
||||
}
|
||||
else if ( $this->ipsclass->input['do'] )
|
||||
else if ( isset($this->ipsclass->input['do']) AND $this->ipsclass->input['do'] )
|
||||
{
|
||||
$this->ipsclass->input['code'] = $this->ipsclass->input['do'];
|
||||
}
|
||||
@@ -166,7 +146,15 @@ class ad_task_manager
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
||||
$this->task_log_delete();
|
||||
break;
|
||||
|
||||
case 'master_xml_export':
|
||||
$this->master_xml_export();
|
||||
break;
|
||||
|
||||
case 'task_rebuild_xml':
|
||||
$this->task_rebuild_xml();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
||||
$this->task_show_tasks();
|
||||
@@ -174,6 +162,179 @@ class ad_task_manager
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Rebuild XML
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function task_rebuild_xml()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$file = ROOT_PATH . 'resources/tasks.xml';
|
||||
$inserted = 0;
|
||||
$updated = 0;
|
||||
$tasks = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! file_exists( $file ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = "$file could not be found. Please check, upload or try again";
|
||||
$this->show_intro();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get current task info
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*',
|
||||
'from' => 'task_manager' ) );
|
||||
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while( $row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$tasks[ $row['task_key'] ] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get XML
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get XML file (CSS/WRAPPERS)
|
||||
//-----------------------------------------
|
||||
|
||||
$skin_content = implode( "", file($file) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unpack the datafile (TEMPLATES)
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_parse_document( $skin_content );
|
||||
|
||||
//-----------------------------------------
|
||||
// TASKS
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $xml->xml_array['export']['group']['row'] as $id => $entry )
|
||||
{
|
||||
$newrow = array();
|
||||
|
||||
$_key = $entry['task_key']['VALUE'];
|
||||
|
||||
foreach( $entry as $f => $data )
|
||||
{
|
||||
if ( $f == 'VALUE' or $f == 'task_id' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $f == 'task_cronkey' )
|
||||
{
|
||||
$entry[ $f ]['VALUE'] = $tasks[ $_key ]['task_cronkey'] ? $tasks[ $_key ]['task_cronkey'] : md5( uniqid( microtime() ) );
|
||||
}
|
||||
|
||||
if ( $f == 'task_next_run' )
|
||||
{
|
||||
$entry[ $f ]['VALUE'] = $tasks[ $_key ]['task_next_run'] ? $tasks[ $_key ]['task_next_run'] : time();
|
||||
}
|
||||
|
||||
$newrow[$f] = $entry[ $f ]['VALUE'];
|
||||
}
|
||||
|
||||
if ( $tasks[ $_key ]['task_key'] )
|
||||
{
|
||||
$updated++;
|
||||
$this->ipsclass->DB->do_update( 'task_manager', $newrow, "task_key='" . $tasks[ $_key ]['task_key'] . "'" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$inserted++;
|
||||
$this->ipsclass->DB->do_insert( 'task_manager', $newrow );
|
||||
}
|
||||
}
|
||||
|
||||
$this->ipsclass->main_msg = "$inserted tasks added, $updated updated";
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Export Master XML
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function master_xml_export()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$entry = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get XML class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
$xml->doc_type = $this->ipsclass->vars['gb_char_set'];
|
||||
|
||||
$xml->xml_set_root( 'export', array( 'exported' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set group
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_add_group( 'group' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get templates...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
|
||||
'from' => 'task_manager' ) );
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$content = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort the fields...
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $r as $k => $v )
|
||||
{
|
||||
$content[] = $xml->xml_build_simple_tag( $k, $v );
|
||||
}
|
||||
|
||||
$entry[] = $xml->xml_build_entry( 'row', $content );
|
||||
}
|
||||
|
||||
$xml->xml_add_entry_to_group( 'group', $entry );
|
||||
|
||||
$xml->xml_format_document();
|
||||
|
||||
$doc = $xml->xml_document;
|
||||
|
||||
//-----------------------------------------
|
||||
// Print to browser
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->show_download( $doc, 'tasks.xml', '', 0 );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// TASK LOG DELETE
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -198,7 +359,7 @@ class ad_task_manager
|
||||
|
||||
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'task_logs', 'where' => $where ) );
|
||||
|
||||
$this->ipsclass->main_msg = 'Âûáðàííûå ëîãè âûïîëíåííûõ çàäà÷ óäàëåíû';
|
||||
$this->ipsclass->main_msg = 'Selected Task Logs Removed';
|
||||
$this->task_log_setup();
|
||||
}
|
||||
|
||||
@@ -208,12 +369,14 @@ class ad_task_manager
|
||||
|
||||
function task_log_show()
|
||||
{
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Viewing Task Logs' );
|
||||
|
||||
//-----------------------------------------
|
||||
// SHOW 'EM
|
||||
//-----------------------------------------
|
||||
|
||||
$limit = $this->ipsclass->input['task_count'] ? $this->ipsclass->input['task_count'] : 30;
|
||||
$limit = $limit > 150 ? 150 : $limit;
|
||||
$limit = $limit > 150 ? 150 : intval($limit);
|
||||
|
||||
if ( $this->ipsclass->input['task_id'] != -1 )
|
||||
{
|
||||
@@ -226,12 +389,12 @@ class ad_task_manager
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( "Âûïîëíåííàÿ çàäà÷à" , "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà è Âðåìÿ" , "35%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Èíôîðìàöèÿ", "45%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Task Run" , "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Date Run" , "35%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Log Info" , "45%" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Âûáðàííûå ëîãè çàäà÷" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Selected Task Logs" );
|
||||
|
||||
if ( $this->ipsclass->DB->get_num_rows() )
|
||||
{
|
||||
@@ -245,7 +408,7 @@ class ad_task_manager
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("<center>Íåò çàïèñåé</center>");
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("<center>No results</center>");
|
||||
}
|
||||
|
||||
|
||||
@@ -261,11 +424,13 @@ class ad_task_manager
|
||||
|
||||
function task_log_setup()
|
||||
{
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Viewing Task Logs' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Some set up
|
||||
//-----------------------------------------
|
||||
|
||||
$tasks = array( 0 => array( -1, 'Âñå çàäà÷è' ) );
|
||||
$tasks = array( 0 => array( -1, 'All tasks' ) );
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'task_manager', 'order' => 'task_title' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
@@ -283,12 +448,12 @@ class ad_task_manager
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( "Âûïîëíåííàÿ çàäà÷à" , "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà Âðåìÿ" , "35%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Èíôîðìàöèÿ" , "45%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Task Run" , "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Date Run" , "35%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Log Info" , "45%" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "5 ïîñëåäíèõ çàïóùåííûõ çàäà÷" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Last 5 Tasks Run" );
|
||||
|
||||
if ( $this->ipsclass->DB->get_num_rows() )
|
||||
{
|
||||
@@ -302,7 +467,7 @@ class ad_task_manager
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("<center>Íåò çàïèñåé</center>");
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("<center>No results</center>");
|
||||
}
|
||||
|
||||
|
||||
@@ -322,17 +487,17 @@ class ad_task_manager
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðîñìîòð ëîãîâ âûïîëíåííûõ çàäà÷" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "View Task Logs" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïðîñìîòð ëîãîâ âûïîëíåííîé çàäà÷è:</b>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>View logs for task:</b>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'task_id', $tasks )
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñêîëüêî âûâåñòè çàïèñåé?</b>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Show how many log entries?</b>",
|
||||
$this->ipsclass->adskin->form_input( 'task_count', '30' )
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form('Ñìîòðåòü ëîãè');
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form('View Logs');
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
@@ -349,17 +514,17 @@ class ad_task_manager
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Óäàëèòü ëîãè âûïîëíåííîé çàäà÷è" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "DELETE Task Logs" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Óäàëèòü ëîãè çàäà÷è:</b>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Delete logs for task:</b>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'task_id', $tasks )
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Óäàëèòü ëîãè ñòàðøå, ÷åì (â äíÿõ):</b>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Delete logs older than (in days)?</b>",
|
||||
$this->ipsclass->adskin->form_input( 'task_prune', '30' )
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form('Óäàëèòü ëîãè');
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form('DELETE Logs');
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
@@ -381,7 +546,7 @@ class ad_task_manager
|
||||
|
||||
$this->ipsclass->DB->do_update( 'task_manager', array( 'task_locked' => 0 ), "task_id=".$task_id );
|
||||
|
||||
$this->ipsclass->main_msg = 'Çàêðûòûå çàäà÷è óäàëåíû';
|
||||
$this->ipsclass->main_msg = 'Task lock removed';
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
|
||||
@@ -403,7 +568,7 @@ class ad_task_manager
|
||||
|
||||
if ( ! $task_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íå óêàçàí ID çàäà÷è, äåéñòâèå íå âûïîëíåíî';
|
||||
$this->ipsclass->main_msg = 'No ID was passed, cannot save';
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
|
||||
@@ -411,13 +576,13 @@ class ad_task_manager
|
||||
|
||||
if ( ! $this_task['task_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íåò çàäà÷ äëÿ âûïîëíåíèÿ.';
|
||||
$this->ipsclass->main_msg = 'No task to run.';
|
||||
$this->show_tasks();
|
||||
}
|
||||
|
||||
if ( ! $this_task['task_enabled'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Ýòà çàäà÷à îòêëþ÷åíà. Ïîæàëóéñòà, âêëþ÷èòå åå äî çàïóñêà.";
|
||||
$this->ipsclass->main_msg = "This task has been disabled. Please enable the task before running it.";
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
|
||||
@@ -434,7 +599,7 @@ class ad_task_manager
|
||||
|
||||
if ( $this_task['task_locked'] > 0 )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Ýòà çàäà÷à áûëà çàêðûòà â ". gmdate( 'j M Y - G:i', $this_task['task_locked'] ) ." è íå ìîæåò áûòü çàïóùåíà ïîêà Âû åå íå îòêðîåòå ñíîâà.";
|
||||
$this->ipsclass->main_msg = "This task was locked at ". gmdate( 'j M Y - G:i', $this_task['task_locked'] ) ." and cannot be run until unlocked.";
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
|
||||
@@ -454,12 +619,12 @@ class ad_task_manager
|
||||
$myobj->pass_task( $this_task );
|
||||
$myobj->run_task();
|
||||
|
||||
$this->ipsclass->main_msg = 'Çàäà÷à óñïåøíî çàïóùåíà';
|
||||
$this->ipsclass->main_msg = 'Task run successfully';
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íåâîçìîæíî íàéòè: '.$func->root_path.'sources/tasks/'.$this_task['task_file'];
|
||||
$this->ipsclass->main_msg = 'Cannot locate: '.$func->root_path.'sources/tasks/'.$this_task['task_file'];
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
}
|
||||
@@ -484,7 +649,7 @@ class ad_task_manager
|
||||
|
||||
if ( $task['task_safemode'] and ! IN_DEV )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Âû íå ìîæåòå óäàëèòü ýòó çàäà÷ó.";
|
||||
$this->ipsclass->main_msg = "You are unable to delete this task.";
|
||||
$this->task_show_tasks();
|
||||
return;
|
||||
}
|
||||
@@ -497,7 +662,7 @@ class ad_task_manager
|
||||
|
||||
$this->functions->save_next_run_stamp();
|
||||
|
||||
$this->ipsclass->main_msg = 'Çàäà÷à óäàëåíà!';
|
||||
$this->ipsclass->main_msg = 'Task deleted';
|
||||
|
||||
$this->task_show_tasks();
|
||||
}
|
||||
@@ -523,20 +688,20 @@ class ad_task_manager
|
||||
{
|
||||
if ( ! $task_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íå óêàçàí ID çàäà÷è, äåéñòâèå íå âûïîëíåíî';
|
||||
$this->ipsclass->main_msg = 'No ID was passed, cannot save';
|
||||
$this->task_form();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->ipsclass->input['task_title'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Âû äîëæíû ââåñòè íàçâàíèå çàäà÷è.';
|
||||
$this->ipsclass->main_msg = 'You must enter a task title.';
|
||||
$this->task_form();
|
||||
}
|
||||
|
||||
if ( ! $this->ipsclass->input['task_file'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Âû äîëæíû ââåñòè èìÿ ôàéëà äëÿ èñïîëíåíèÿ';
|
||||
$this->ipsclass->main_msg = 'You must enter a filename for this task to run';
|
||||
$this->task_form();
|
||||
}
|
||||
|
||||
@@ -544,7 +709,7 @@ class ad_task_manager
|
||||
// Check the task file...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->input['task_file'] = str_replace( '../', '', $this->ipsclass->input['task_file'] );
|
||||
$this->ipsclass->input['task_file'] = preg_replace( '#\.{1,}#s', '.', $this->ipsclass->input['task_file'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile task
|
||||
@@ -577,12 +742,12 @@ class ad_task_manager
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'task_manager', $save, 'task_id='.$task_id );
|
||||
$this->ipsclass->main_msg = 'Çàäà÷à óñïåøíî èçìåíåíà';
|
||||
$this->ipsclass->main_msg = 'Task Edited Successfully';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->do_insert( 'task_manager', $save );
|
||||
$this->ipsclass->main_msg = 'Çàäà÷à óñïåøíî ñîõðàíåíà';
|
||||
$this->ipsclass->main_msg = 'Task Saved Successfully';
|
||||
}
|
||||
|
||||
$this->functions->save_next_run_stamp();
|
||||
@@ -597,6 +762,8 @@ class ad_task_manager
|
||||
|
||||
function task_form($type='edit')
|
||||
{
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Add/Edit Task' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Init Vars
|
||||
//-----------------------------------------
|
||||
@@ -613,7 +780,7 @@ class ad_task_manager
|
||||
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
$button = "Îòðåäàêòèðîâàòü çàäà÷ó";
|
||||
$button = "Edit Task";
|
||||
$formbit = "task_edit_do";
|
||||
$this->ipsclass->html_help_title = "";
|
||||
$this->ipsclass->html_help_msg = "";
|
||||
@@ -622,31 +789,31 @@ class ad_task_manager
|
||||
|
||||
if ( $task['task_safemode'] and ! IN_DEV )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Âû íå ìîæåòå èçìåíèòü ýòó çàäà÷ó.";
|
||||
$this->ipsclass->main_msg = "You are unable to edit this task.";
|
||||
$this->task_show_tasks();
|
||||
return;
|
||||
}
|
||||
|
||||
$title = "Èçìåíåíèå çàäà÷è: ".$group['cb_group_name'];
|
||||
$title = "Editing Task: ".$group['cb_group_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$button = "Äîáàâèòü ýòó çàäà÷ó";
|
||||
$button = "Create New Task";
|
||||
$formbit = "task_add_do";
|
||||
$this->ipsclass->html_help_title = "";
|
||||
$this->ipsclass->html_help_msg = "";
|
||||
$task = array();
|
||||
$title = "Äîáàâëåíèå çàäà÷è";
|
||||
$title = "Creating New Task";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Create drop downs
|
||||
//-----------------------------------------
|
||||
|
||||
$dropdown['_minute'] = array( 0 => array( '-1', 'Êàæäóþ ìèíóòó' ) );
|
||||
$dropdown['_hour'] = array( 0 => array( '-1', 'Êàæäûé ÷àñ' ), 1 => array( '0', '0 - Ïîëíî÷ü' ) );
|
||||
$dropdown['_wday'] = array( 0 => array( '-1', 'Êàæäûé äåíü íåäåëè' ) );
|
||||
$dropdown['_mday'] = array( 0 => array( '-1', 'Êàæäûé äåíü ìåñÿöà' ) );
|
||||
$dropdown['_minute'] = array( 0 => array( '-1', 'Every Minute' ) );
|
||||
$dropdown['_hour'] = array( 0 => array( '-1', 'Every Hour' ), 1 => array( '0', '0 - Midnight' ) );
|
||||
$dropdown['_wday'] = array( 0 => array( '-1', 'Every Week Day' ) );
|
||||
$dropdown['_mday'] = array( 0 => array( '-1', 'Every Day of the Month' ) );
|
||||
|
||||
for( $i = 0 ; $i < 60; $i++ )
|
||||
{
|
||||
@@ -661,7 +828,7 @@ class ad_task_manager
|
||||
}
|
||||
else if ( $i == 12 )
|
||||
{
|
||||
$ampm = 'Ïîëäåíü';
|
||||
$ampm = 'Midday';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -676,13 +843,13 @@ class ad_task_manager
|
||||
$dropdown['_mday'][] = array( $i, $i );
|
||||
}
|
||||
|
||||
$dropdown['_wday'][] = array( '0', 'Âîñêðåñåíüå' );
|
||||
$dropdown['_wday'][] = array( '1', 'Ïîíåäåëüíèê' );
|
||||
$dropdown['_wday'][] = array( '2', 'Âòîðíèê' );
|
||||
$dropdown['_wday'][] = array( '3', 'Ñðåäà' );
|
||||
$dropdown['_wday'][] = array( '4', '×åòâåðã' );
|
||||
$dropdown['_wday'][] = array( '5', 'Ïÿòíèöà' );
|
||||
$dropdown['_wday'][] = array( '6', 'Ñóááîòà' );
|
||||
$dropdown['_wday'][] = array( '0', 'Sunday' );
|
||||
$dropdown['_wday'][] = array( '1', 'Monday' );
|
||||
$dropdown['_wday'][] = array( '2', 'Tuesday' );
|
||||
$dropdown['_wday'][] = array( '3', 'Wednesday' );
|
||||
$dropdown['_wday'][] = array( '4', 'Thursday' );
|
||||
$dropdown['_wday'][] = array( '5', 'Friday' );
|
||||
$dropdown['_wday'][] = array( '6', 'Saturday' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Form elements
|
||||
@@ -746,14 +913,11 @@ class ad_task_manager
|
||||
$row['_image'] = 'task_run.gif';
|
||||
}
|
||||
|
||||
$row['_next_run'] = gmdate( 'j.n.Y, G:i', $row['task_next_run'] );
|
||||
$row['_next_run'] = gmdate( 'j M Y - G:i', $row['task_next_run'] );
|
||||
|
||||
if ( $row['task_enabled'] != 1 )
|
||||
{
|
||||
$row['_class'] = " style='color:gray'";
|
||||
$row['_title'] = " (Îòêëþ÷åíî)";
|
||||
$row['_next_run'] = "<span style='color:gray'><s>{$row['_next_run']}</s></span>";
|
||||
}
|
||||
$row['_class'] = $row['task_enabled'] != 1 ? " style='color:gray'" : '';
|
||||
$row['_title'] = $row['task_enabled'] != 1 ? " (Disabled)" : '';
|
||||
$row['_next_run'] = $row['task_enabled'] != 1 ? "<span style='color:gray'><s>{$row['_next_run']}</s></span>" : $row['_next_run'];
|
||||
|
||||
$content .= $this->html->task_manager_row( $row );
|
||||
}
|
||||
@@ -762,7 +926,7 @@ class ad_task_manager
|
||||
// Print it
|
||||
//-------------------------------
|
||||
|
||||
$this->ipsclass->html .= $this->html->task_manager_wrapper( $content, gmdate( 'j.n.Y, G:i' ) );
|
||||
$this->ipsclass->html .= $this->html->task_manager_wrapper( $content, gmdate( 'jS F Y - h:i A' ) );
|
||||
$this->ipsclass->admin->output();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user