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,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| 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
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 23 $
|
||||
| > $Date: 2006-10-06 10:09:22 +0100 (Fri, 06 Oct 2006) $
|
||||
| > $Revision: 611 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
@@ -34,7 +24,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();
|
||||
}
|
||||
|
||||
@@ -42,6 +32,7 @@ class ad_components
|
||||
{
|
||||
# Globals
|
||||
var $ipsclass;
|
||||
var $html;
|
||||
|
||||
var $perm_main = 'admin';
|
||||
var $perm_child = 'components';
|
||||
@@ -56,6 +47,10 @@ class ad_components
|
||||
|
||||
switch($this->ipsclass->input['code'])
|
||||
{
|
||||
case 'master_xml_export':
|
||||
$this->master_xml_export();
|
||||
break;
|
||||
|
||||
case 'manage':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
||||
$this->components_list();
|
||||
@@ -78,6 +73,11 @@ class ad_components
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
||||
$this->components_save('edit');
|
||||
break;
|
||||
|
||||
case 'component_delete':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
||||
$this->components_delete();
|
||||
break;
|
||||
|
||||
case 'component_export':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':export' );
|
||||
@@ -103,6 +103,75 @@ class ad_components
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// 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' => 'components',
|
||||
'where' => "com_section != 'bugtracker'" ) );
|
||||
|
||||
$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, 'components.xml', '', 0 );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Components: Toggle enabled
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -121,7 +190,7 @@ class ad_components
|
||||
|
||||
if ( ! $com_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå îäèí ID íå âûáðàí, ïîâòîðèòå ïîïûòêó çàíîâî ";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
@@ -138,7 +207,7 @@ class ad_components
|
||||
|
||||
$this->components_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "Ïåðåêëþ÷àòåëü êîìïîíåíòîâ";
|
||||
$this->ipsclass->main_msg = "Component Toggled";
|
||||
$this->components_list();
|
||||
}
|
||||
|
||||
@@ -152,8 +221,12 @@ class ad_components
|
||||
// INIT
|
||||
//--------------------------------------------
|
||||
|
||||
$com_id = intval($this->ipsclass->input['com_id']);
|
||||
$move = trim($this->ipsclass->input['move']);
|
||||
$com_id = intval($this->ipsclass->input['com_id']);
|
||||
$move = trim($this->ipsclass->input['move']);
|
||||
$components = array();
|
||||
$final_coms = array();
|
||||
$used_pos = array();
|
||||
$max_pos = 0;
|
||||
|
||||
//--------------------------------------------
|
||||
// Checks...
|
||||
@@ -161,24 +234,97 @@ class ad_components
|
||||
|
||||
if ( ! $com_id OR ! $move )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå îäèí ID íå âûáðàí, ïîâòîðèòå ïîïûòêó çàíîâî ";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// Get from database
|
||||
// Get components from database
|
||||
//--------------------------------------------
|
||||
|
||||
$component = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'components', 'where' => 'com_id='.$com_id ) );
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*',
|
||||
'from' => 'components',
|
||||
'order' => 'com_position ASC' ) );
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
$new_position = ( $move == 'up' ) ? intval($component['com_position']) - 1 : intval($component['com_position']) + 1;
|
||||
while( $c = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$max_pos += 1;
|
||||
|
||||
if ( in_array( $c['com_position'], $used_pos ) )
|
||||
{
|
||||
|
||||
$c['com_position'] = $max_pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
$used_pos[] = $c['com_position'];
|
||||
}
|
||||
|
||||
$components[ $c['com_id'] ] = $c['com_position'];
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->do_update( 'components', array( 'com_position' => $new_position ), 'com_id='.$com_id );
|
||||
asort($components);
|
||||
|
||||
$i = 0;
|
||||
$did_move = 0;
|
||||
|
||||
foreach( $components as $k => $v )
|
||||
{
|
||||
$i++;
|
||||
|
||||
if( $k == $com_id )
|
||||
{
|
||||
if( $move == 'up' )
|
||||
{
|
||||
// Move up (lower #)
|
||||
$last = array_pop( $final_coms );
|
||||
$final_coms[ $k ] = $i - 1;
|
||||
|
||||
foreach( $components as $k2 => $v2 )
|
||||
{
|
||||
if ( $v2 == $last )
|
||||
{
|
||||
$final_coms[ $k2 ] = $i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Move down (higher #)
|
||||
|
||||
$final_coms[ $k ] = $i + 1;
|
||||
$did_move = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $did_move == 1 )
|
||||
{
|
||||
$final_coms[ $k ] = $i - 1;
|
||||
$did_move = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$final_coms[ $k ] = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*echo "<pre>";
|
||||
print_r($final_coms);
|
||||
exit;*/
|
||||
|
||||
foreach( $final_coms as $k => $v )
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'components', array( 'com_position' => $v ), 'com_id='.$k );
|
||||
}
|
||||
|
||||
$this->components_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "Ôîðìèðîâàíèå ïóíêòîâ êîìïîíåíòà";
|
||||
$this->ipsclass->main_msg = "Component item repositioned";
|
||||
$this->components_list();
|
||||
}
|
||||
|
||||
@@ -226,14 +372,14 @@ class ad_components
|
||||
|
||||
if ( ! $this->ipsclass->input['file_location'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Çàãðóæàåìûé ôàéë íå íàéäåí!.";
|
||||
$this->ipsclass->main_msg = "No upload file was found and no filename was specified.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! file_exists( ROOT_PATH . $this->ipsclass->input['file_location'] ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íåëüçÿ íàéòè ôàéë äëÿ îòêðûòèÿ:: " . ROOT_PATH . $this->ipsclass->input['file_location'];
|
||||
$this->ipsclass->main_msg = "Could not find the file to open at: " . ROOT_PATH . $this->ipsclass->input['file_location'];
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
@@ -269,6 +415,13 @@ class ad_components
|
||||
$tmp_name = preg_replace( "#\.gz$#", "", $tmp_name );
|
||||
|
||||
$content = $this->ipsclass->admin->import_xml( $tmp_name );
|
||||
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Could not read the uploaded file.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -290,7 +443,7 @@ class ad_components
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require( KERNEL_PATH.'class_xml.php' );
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
@@ -320,7 +473,7 @@ class ad_components
|
||||
$xml->xml_array['componentexport']['componentgroup']['component'][0] = $tmp;
|
||||
}
|
||||
|
||||
foreach( $xml->xml_array['componentexport']['componentgroup']['component'] as $id => $entry )
|
||||
foreach( $xml->xml_array['componentexport']['componentgroup']['component'] as $entry )
|
||||
{
|
||||
$newrow = array();
|
||||
|
||||
@@ -359,7 +512,7 @@ class ad_components
|
||||
|
||||
$this->components_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "$updated êîìïîíåíòîâ îáíîâëåíî $inserted êîìïîíåíòîâ âñòàâëåíî";
|
||||
$this->ipsclass->main_msg = "$updated components updated $inserted components inserted";
|
||||
|
||||
$this->components_list();
|
||||
}
|
||||
@@ -385,7 +538,7 @@ class ad_components
|
||||
{
|
||||
if ( ! $com_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå îäèí ID íå âûáðàí, ïîâòîðèòå ïîïûòêó çàíîâî ";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
@@ -435,7 +588,7 @@ class ad_components
|
||||
|
||||
$entry = array();
|
||||
|
||||
foreach( $rows as $idx => $r )
|
||||
foreach( $rows as $r )
|
||||
{
|
||||
$content = array();
|
||||
|
||||
@@ -471,15 +624,15 @@ class ad_components
|
||||
//--------------------------------------------
|
||||
|
||||
$com_id = intval($this->ipsclass->input['com_id']);
|
||||
$com_title = trim( $this->ipsclass->input['com_title'] );
|
||||
$com_version = trim( $this->ipsclass->input['com_version'] );
|
||||
$com_description = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_UNhtmlspecialchars($_POST['com_description'])) );
|
||||
$com_author = trim( $this->ipsclass->input['com_author'] );
|
||||
$com_url = trim( $this->ipsclass->input['com_url'] );
|
||||
$com_title = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_title']) );
|
||||
$com_version = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_version']) );
|
||||
$com_description = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_htmlspecialchars($_POST['com_description'])) );
|
||||
$com_author = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_author']) );
|
||||
$com_url = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_url']) );
|
||||
//$com_menu_data = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_windowstounix($_POST['com_menu_data']) ) );
|
||||
$com_enabled = intval($this->ipsclass->input['com_enabled']);
|
||||
$com_section = trim( $this->ipsclass->input['com_section'] );
|
||||
$com_filename = trim( $this->ipsclass->input['com_section'] );
|
||||
$com_section = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_section']) );
|
||||
$com_filename = trim( $this->ipsclass->txt_stripslashes($this->ipsclass->input['com_section']) );
|
||||
$com_safemode = intval($this->ipsclass->input['com_safemode']);
|
||||
$com_url_title = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_windowstounix($_POST['com_url_title']) ) );
|
||||
$com_url_uri = trim( $this->ipsclass->txt_stripslashes( $this->ipsclass->txt_windowstounix($_POST['com_url_uri']) ) );
|
||||
@@ -492,7 +645,7 @@ class ad_components
|
||||
{
|
||||
if ( ! $com_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå îäèí ID íå âûáðàí, ïîâòîðèòå ïîïûòêó çàíîâî ";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
@@ -500,7 +653,7 @@ class ad_components
|
||||
|
||||
if ( ! $com_title OR ! $com_section OR ! $com_filename )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Âû äîëæíû çàïîëíèòü âñå ïîëÿ.";
|
||||
$this->ipsclass->main_msg = "You must complete the entire form.";
|
||||
$this->components_form( $type );
|
||||
return;
|
||||
}
|
||||
@@ -558,7 +711,7 @@ class ad_components
|
||||
|
||||
if ( $test['com_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Óáåäèòåñü â òîì, ÷òî îáà ðàçäåëà êîäà è èìÿ ôàéëà îäèíàêîâû äëÿ ýòîãî êîìïîíåíòà.";
|
||||
$this->ipsclass->main_msg = "You must ensure that both the section code and the filename are unique to this component.";
|
||||
$this->components_form( $type );
|
||||
return;
|
||||
}
|
||||
@@ -566,13 +719,13 @@ class ad_components
|
||||
$array['com_date_added'] = time();
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'components', $array );
|
||||
$this->ipsclass->main_msg = 'Íîâûé êîìïîíåíò äîáàâëåí';
|
||||
$this->ipsclass->main_msg = 'New Component Added';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->ipsclass->DB->do_update( 'components', $array, 'com_id='.$com_id );
|
||||
$this->ipsclass->main_msg = 'Êîìïîíåíò èçìåíåí';
|
||||
$this->ipsclass->main_msg = 'Component Edited';
|
||||
}
|
||||
|
||||
$this->components_rebuildcache();
|
||||
@@ -605,8 +758,8 @@ class ad_components
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$formcode = 'component_add_do';
|
||||
$title = "Ðåãèñòðàöèÿ íîâîãî êîìïîíåíòà";
|
||||
$button = "Ðåãèñòðàöèÿ";
|
||||
$title = "Register New Component";
|
||||
$button = "Register New Component";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -614,14 +767,14 @@ class ad_components
|
||||
|
||||
if ( ! $component['com_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå îäèí ID íå âûáðàí, ïîâòîðèòå ïîïûòêó çàíîâî.";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
$formcode = 'component_edit_do';
|
||||
$title = "Ðåäàêòèðîâàíèå êîìïîíåíòà ".$component['com_title'];
|
||||
$button = "Ñîõðàíèòü èçìåíåíèÿ";
|
||||
$title = "Edit Component ".$component['com_title'];
|
||||
$button = "Save Changes";
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
@@ -695,28 +848,29 @@ class ad_components
|
||||
|
||||
$form = array();
|
||||
|
||||
$form['com_title'] = $this->ipsclass->adskin->form_input( 'com_title' , $_POST['com_title'] ? $_POST['com_title'] : $component['com_title'] );
|
||||
$form['com_description'] = $this->ipsclass->adskin->form_input( 'com_description', $this->ipsclass->txt_htmlspecialchars( $_POST['com_description'] ? $_POST['com_description'] : $component['com_description'] ) );
|
||||
$form['com_author'] = $this->ipsclass->adskin->form_input( 'com_author' , $_POST['com_author'] ? $_POST['com_author'] : $component['com_author'] );
|
||||
$form['com_url'] = $this->ipsclass->adskin->form_input( 'com_url' , $_POST['com_url'] ? $_POST['com_url'] : $component['com_url'] );
|
||||
$form['com_version'] = $this->ipsclass->adskin->form_simple_input( 'com_version' , $_POST['com_version'] ? $_POST['com_version'] : $component['com_version'], 10 );
|
||||
$form['com_enabled'] = $this->ipsclass->adskin->form_yes_no( 'com_enabled' , $_POST['com_enabled'] ? $_POST['com_enabled'] : $component['com_enabled'] );
|
||||
$form['com_section'] = $this->ipsclass->adskin->form_simple_input( 'com_section' , $_POST['com_section'] ? $_POST['com_section'] : $component['com_section'], 20 );
|
||||
$form['com_filename'] = $this->ipsclass->adskin->form_simple_input( 'com_filename' , $_POST['com_filename'] ? $_POST['com_filename'] : $component['com_filename'], 20 );
|
||||
$form['com_url_title'] = $this->ipsclass->adskin->form_input( 'com_url_title' , $this->ipsclass->txt_htmlspecialchars( $_POST['com_url_title'] ? $_POST['com_url_title'] : $component['com_url_title'] ) );
|
||||
$form['com_url_uri'] = $this->ipsclass->adskin->form_input( 'com_url_uri' , $this->ipsclass->txt_htmlspecialchars( $_POST['com_url_uri'] ? $_POST['com_url_uri'] : $component['com_url_uri'] ) );
|
||||
$form['com_title'] = $this->ipsclass->adskin->form_input( 'com_title' , $this->ipsclass->input['com_title'] ? stripslashes($this->ipsclass->input['com_title']) : $component['com_title'] );
|
||||
$form['com_description'] = $this->ipsclass->adskin->form_input( 'com_description', $this->ipsclass->input['com_description'] ? stripslashes($this->ipsclass->input['com_description']) : $component['com_description'] );
|
||||
$form['com_author'] = $this->ipsclass->adskin->form_input( 'com_author' , $this->ipsclass->input['com_author'] ? stripslashes($this->ipsclass->input['com_author']) : $component['com_author'] );
|
||||
$form['com_url'] = $this->ipsclass->adskin->form_input( 'com_url' , $this->ipsclass->input['com_url'] ? stripslashes($this->ipsclass->input['com_url']) : $component['com_url'] );
|
||||
$form['com_version'] = $this->ipsclass->adskin->form_simple_input( 'com_version' , $this->ipsclass->input['com_version'] ? stripslashes($this->ipsclass->input['com_version']) : $component['com_version'], 10 );
|
||||
$form['com_enabled'] = $this->ipsclass->adskin->form_yes_no( 'com_enabled' , $this->ipsclass->input['com_enabled'] ? stripslashes($this->ipsclass->input['com_enabled']) : $component['com_enabled'] );
|
||||
$form['com_section'] = $this->ipsclass->adskin->form_simple_input( 'com_section' , $this->ipsclass->input['com_section'] ? stripslashes($this->ipsclass->input['com_section']) : $component['com_section'], 20 );
|
||||
$form['com_filename'] = $this->ipsclass->adskin->form_simple_input( 'com_filename' , $this->ipsclass->input['com_filename'] ? stripslashes($this->ipsclass->input['com_filename']) : $component['com_filename'], 20 );
|
||||
$form['com_url_title'] = $this->ipsclass->adskin->form_input( 'com_url_title' , $this->ipsclass->input['com_url_title'] ? stripslashes($this->ipsclass->input['com_url_title']) : $component['com_url_title'] );
|
||||
$form['com_url_uri'] = $this->ipsclass->adskin->form_input( 'com_url_uri' , $this->ipsclass->input['com_url_uri'] ? stripslashes($this->ipsclass->input['com_url_uri']) : $component['com_url_uri'] );
|
||||
|
||||
if ( IN_DEV )
|
||||
{
|
||||
$form['com_safemode'] = $this->ipsclass->adskin->form_yes_no( 'com_safemode', $_POST['com_safemode'] ? $_POST['com_safemode']: $component['com_safemode'] );
|
||||
$form['com_safemode'] = $this->ipsclass->adskin->form_yes_no( 'com_safemode', $this->ipsclass->input['com_safemode'] ? $this->ipsclass->input['com_safemode']: $component['com_safemode'] );
|
||||
}
|
||||
|
||||
$this->ipsclass->html .= $this->html->components_form( $form, $title, $formcode, $button, $component, $menu_text, $menu_url, $menu_redirect, $menu_permbit, $menu_permlang );
|
||||
|
||||
$this->ipsclass->html_help_title = "Óïðàâëåíèå êîìïîíåíòàìè";
|
||||
$this->ipsclass->html_help_msg = "Ýòà ñåêöèÿ ïîçâîëèò âàì óïðàâëÿòü êîìïîíåíòàìè ôîðóìà.";
|
||||
$this->ipsclass->html_help_title = "Components Manager";
|
||||
$this->ipsclass->html_help_msg = "This section will allow you to manage your components.";
|
||||
|
||||
$this->ipsclass->admin->nav[] = array( "{$this->ipsclass->form_code}", "Êîìïîíåíòû" );
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Manage Components' );
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Add/Edit Components' );
|
||||
$this->ipsclass->admin->output();
|
||||
}
|
||||
|
||||
@@ -726,7 +880,9 @@ class ad_components
|
||||
|
||||
function components_list()
|
||||
{
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Óïðàâëåíèå êîìïîíåíòàìè' );
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Manage Components' );
|
||||
$this->ipsclass->admin->page_title = "Components Manager";
|
||||
$this->ipsclass->admin->page_detail = "This section will allow you to manage your components.";
|
||||
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -750,7 +906,7 @@ class ad_components
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
foreach( $rows as $i => $r )
|
||||
foreach( $rows as $r )
|
||||
{
|
||||
//-------------------------------
|
||||
// Version...
|
||||
@@ -815,13 +971,47 @@ class ad_components
|
||||
|
||||
$this->ipsclass->html .= $this->html->component_overview( $content );
|
||||
|
||||
$this->ipsclass->admin->page_title = "Óïðàâëåíèå êîìïîíåíòàìè";
|
||||
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëèò âàì óïðàâëÿòü êîìïîíåíòàìè ôîðóìà.";
|
||||
$this->ipsclass->admin->output();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function components_delete( )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init Vars
|
||||
//-----------------------------------------
|
||||
|
||||
$com_id = intval($this->ipsclass->input['com_id']);
|
||||
|
||||
if( !$com_id )
|
||||
{
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
$component = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'components', 'where' => 'com_id='.$com_id ) );
|
||||
|
||||
if ( ! $component['com_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
if( $component['com_safemode'] && !IN_DEV )
|
||||
{
|
||||
$this->ipsclass->main_msg = "This component cannot be edited or deleted.";
|
||||
$this->components_list();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'components', 'where' => 'com_id='.$com_id ) );
|
||||
|
||||
$this->components_rebuildcache();
|
||||
$this->ipsclass->main_msg = "The component has been deleted.";
|
||||
$this->components_list();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user