Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -2,18 +2,28 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:54 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-10-26 14:14:27 -0500 (Thu, 26 Oct 2006) $
|
||||
| > $Revision: 679 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > API: Components
|
||||
@@ -24,25 +34,25 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* API: Components
|
||||
* API: Êîìïîíåíòîâ ôîðóìà
|
||||
*
|
||||
* EXAMPLE USAGE
|
||||
* ÏÐÈÌÅÐ ÈÑÏÎËÜÇÎÂÀÍÈß
|
||||
* <code>
|
||||
* //-- UPDATE EXISTING ROW --//
|
||||
* //-- ÎÁÍÎÂËÅÍÈÅ ÑÓÙÅÑÒÂÓÞÙÅÃÎ ÊÎÌÏÎÍÅÍÒÀ --//
|
||||
* $api = new api_components();
|
||||
* # Optional - if $ipsclass is not passed, it'll init
|
||||
* # Îïöèîíàëüíî - åñëè $ipsclass íå ïåðåäàåòñÿ â îáúåêò, îí áóäåò èíèöèàëèçèðîâàí ñàìîñòîÿòåëüíî
|
||||
* $api->ipsclass =& $this->ipsclass;
|
||||
* $api->api_init();
|
||||
* $update = array (
|
||||
* 'com_version' => '1.3',
|
||||
* 'com_menu_data' => array( 0 => array(
|
||||
* 'menu_text' => 'Link text',
|
||||
* 'menu_text' => 'Íàçâàíèå ïóíêòà ìåíþ',
|
||||
* 'menu_url' => 'code=showme',
|
||||
* 'menu_redirect' => 0,
|
||||
* 'menu_permbit' => 'keyhere',
|
||||
* 'menu_permlang' => 'Allow CREATE Something' ),
|
||||
* 'menu_permlang' => 'Ïîçâîëÿåò ñîçäàòü ÷òî-òî' ),
|
||||
* 1 => array(
|
||||
* 'menu_text' => 'Link text 2',
|
||||
* 'menu_text' => 'Íàçâàíèå ïóíêòà ìåíþ 2',
|
||||
* 'menu_url' => 'section=tools&act=op&code=showme2',
|
||||
* 'menu_redirect' => 1,
|
||||
* 'menu_permbit' => 'add',
|
||||
@@ -50,23 +60,23 @@
|
||||
* ) );
|
||||
*
|
||||
* $api->acp_component_update( 'blog', $update );
|
||||
* //-- ENABLE A COMPONENT --//
|
||||
* //-- ÂÊËÞ×ÅÍÈÅ ÊÎÌÏÎÍÅÍÒÀ --//
|
||||
* $api->acp_component_enable( 'blog' );
|
||||
* </code>
|
||||
*
|
||||
* COMPONENT FIELDS
|
||||
* ÏÎËß ÊÎÌÏÎÍÅÍÒ (ÑÒÐÓÊÒÓÐÀ ÊÎÌÏÎÍÅÍÒ)
|
||||
* <code>
|
||||
* 'com_title' = Component Title
|
||||
* 'com_author' = Component Author
|
||||
* 'com_version' = Component Version
|
||||
* 'com_url' = Component Home URL
|
||||
* 'com_menu_data' = Component Menu Data Array
|
||||
* 'com_enabled' = Component Enabled
|
||||
* 'com_safemode' = Component Safemode (admins cannot alter)
|
||||
* 'com_section_key' = Component Section (Key, must match filename. eg: blog if using blog.php)
|
||||
* 'com_description' = Component Description
|
||||
* 'com_url_uri' = Component Board Header URL URI
|
||||
* 'com_url_title' = Component Board Header URL Title
|
||||
* 'com_title' = Íàçâàíèå êîìïîíåíòà
|
||||
* 'com_author' = Àâòîð êîìïîíåíòà
|
||||
* 'com_version' = Âåðñèÿ êîìïîíåíòà
|
||||
* 'com_url' = Àäðåñ ñàéòà êîìïîíåíòà
|
||||
* 'com_menu_data' = Ìàññèâ ïóíêòîâ ìåíþ íàñòðîåê êîìïîíåíòà
|
||||
* 'com_enabled' = Ñòàòóñ êîìïîíåíòà (âêëþ÷åí/íå âêëþ÷åí)
|
||||
* 'com_safemode' = Ðåæèì ðàáîòû êîìïîíåíòà (åñëè â safemode àäìèíû íå ìîãóò èçìåíÿòü)
|
||||
* 'com_section_key' = Óíèêàëüíûé êëþ÷ êîìïîíåíòà (Êëþ÷, ñîîòâåòñòâóþùèé íàçâàíèþ ôàéëà, íàïð-ð: blog åñëè èñïîëüçóåòñÿ blog.php)
|
||||
* 'com_description' = Îïèñàíèå êîìïîíåíòà
|
||||
* 'com_url_uri' = URI-àäðåñ êîìïîíåíòà â âåðõíåì ìåíþ ôîðóìà
|
||||
* 'com_url_title' = Íàçâàíèå êîìïîíåíòà â âåðõíåì ìåíþ ôîðóìà
|
||||
* </code>
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
@@ -95,9 +105,9 @@ if ( ! defined('IPS_API_CORE_LOADED') )
|
||||
}
|
||||
|
||||
/**
|
||||
* API: Components
|
||||
* API: Êîìïîíåíòîâ ôîðóìà
|
||||
*
|
||||
* This class deals with all available components functions.
|
||||
* Êëàññ ïðåäîñòàâëÿåò âñå ìåòîäû API äëÿ ðàáîòû ñ êîìïîíåíòàìè ôîðóìà.
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
* @subpackage APIs
|
||||
@@ -108,27 +118,27 @@ if ( ! defined('IPS_API_CORE_LOADED') )
|
||||
class api_components extends api_core
|
||||
{
|
||||
/**
|
||||
* Loaded component
|
||||
* Èíôîðìàöèÿ î êîìïîíåíòå
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $component;
|
||||
|
||||
/**
|
||||
* XML Parser Object
|
||||
* Îáúåêò XML ïàðñåðà
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
var $xml;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get component by key
|
||||
// Ïîëó÷åíèå èíôîðìàöèè î êîìïîíåíòå ïî åãî êëþ÷ó (èìåíè ñåêöèè êîìïîíåíòà)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Updates a component
|
||||
* Ïîëó÷àåò âñþ èíôîðìàöèþ î êîìïîíåíòå
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @return void Populates $this->component
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: blog)
|
||||
* @return void Çàïîëíÿåò $this->component
|
||||
*/
|
||||
function get_component_by_key( $key )
|
||||
{
|
||||
@@ -138,10 +148,10 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Create menu
|
||||
// Ñîçäàíèå ìåíþ
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Creates serialized string from a menu array
|
||||
* Ñîçäàåò ñåðèàëèçîâàííóþ ñòðîêó èç ìàññèâà ìåíþ
|
||||
* <code>
|
||||
* $menu_data [ $item_id ]['menu_text']
|
||||
* $menu_data [ $item_id ]['menu_url']
|
||||
@@ -150,8 +160,8 @@ class api_components extends api_core
|
||||
* $menu_data [ $item_id ]['menu_permlang']
|
||||
* </code>
|
||||
*
|
||||
* @param array multi-dimenisonal array
|
||||
* @return void;
|
||||
* @param array ìíîãîóðîâíåâûé ìàññèâ
|
||||
* @return string ñåðèàëèçîâàííûé ìàññèâ
|
||||
*/
|
||||
function acp_component_create_menu_data( $menu_data )
|
||||
{
|
||||
@@ -163,12 +173,12 @@ class api_components extends api_core
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Import XML File
|
||||
// Èìïîðòèðîâàíèå êîìïîíåíò èç XML ôàéëà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Updates/inserts a component from xml file
|
||||
* Îáíîâëÿåò/äîáàâëÿåò êîìïîíåíòû èç xml ôàéëà
|
||||
*
|
||||
* @param string Path to XML File
|
||||
* @param string Ïóòü ê XML ôàéëó
|
||||
* @return array;
|
||||
*/
|
||||
function acp_component_import( $xml_file_path )
|
||||
@@ -208,6 +218,7 @@ class api_components extends api_core
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$this->xml = new class_xml();
|
||||
$this->xml->lite_parser = 1;
|
||||
|
||||
//-----------------------------------------
|
||||
// Unpack the datafile
|
||||
@@ -220,7 +231,7 @@ class api_components extends api_core
|
||||
//-----------------------------------------
|
||||
|
||||
$fields = array( 'com_title' , 'com_description', 'com_author' , 'com_url', 'com_version', 'com_menu_data',
|
||||
'com_enabled' , 'com_safemode' , 'com_section', 'com_filename' );
|
||||
'com_enabled' , 'com_safemode' , 'com_section', 'com_filename', 'com_url_title', 'com_url_uri' );
|
||||
|
||||
if ( ! is_array( $this->xml->xml_array['componentexport']['componentgroup']['component'][0] ) )
|
||||
{
|
||||
@@ -276,13 +287,14 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Update component
|
||||
// Äîáàâëåíèå êîìïîíåíòà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Updates a component
|
||||
* Äîáàâëÿåò íîâûé êîìïîíåíò â ñèñòåìó
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @param array Component fields ( must match class fields, see class docs )
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: áëîã)
|
||||
* @param array Ìàññèâ îáíîâëÿåìûõ ïîëåé ( äîëæåí ñîâïàäàòü ñî ñòðóêòóðîé
|
||||
* êîìïîíåíò, ñì. â êîììåíòàðèÿõ ê ýòîìó êëàññó )
|
||||
* @return void;
|
||||
*/
|
||||
function acp_component_insert( $key, $fields )
|
||||
@@ -374,13 +386,14 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Update component
|
||||
// Îáíîâëåíèå êîìïîíåíòà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Updates a component
|
||||
* Îáíîâëÿåò ñëæåáíóþ èíôîðìàöèþ êîìïîíåíòà
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @param array Component fields ( must match class fields, see class docs )
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: áëîã)
|
||||
* @param array Ìàññèâ îáíîâëÿåìûõ ïîëåé ( äîëæåí ñîâïàäàòü ñî ñòðóêòóðîé
|
||||
* êîìïîíåíò, ñì. â êîììåíòàðèÿõ ê ýòîìó êëàññó )
|
||||
* @return void;
|
||||
*/
|
||||
function acp_component_update( $key, $fields )
|
||||
@@ -479,12 +492,13 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Remove component
|
||||
// Óäàëåíèå êîìïîíåíòà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Remove a component [ no confirmation screens! ]
|
||||
* Óäàëÿåò êîìïîíåíò èç ñèñòåìó [ Âíèìàíèå, ìåòîä íå ïåðäîñòàâëÿåò
|
||||
* íè êàêèõ ïîäòâåðæäåíèé óäàëåíèÿ ! ]
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: blog)
|
||||
* @return void
|
||||
*/
|
||||
function acp_component_remove( $key )
|
||||
@@ -494,12 +508,13 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Enable component
|
||||
// Âêëþ÷åíèå êîìïîíåíòà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Enable a component
|
||||
* Àêòèâèðóåò êîìïîíåíò - îí ñòàíîâèòñÿ äîñòóïíûì â ïîëüçîâàòåëüñêîé ÷àñòè
|
||||
* ôîðóìà
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: blog)
|
||||
* @return void
|
||||
*/
|
||||
function acp_component_enable( $key )
|
||||
@@ -509,12 +524,12 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Disable component
|
||||
// Îòêëþ÷åíèå êîìïîíåíòà
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Enable a component
|
||||
* Äåàêòèâèðóåò êîìïîíåíò
|
||||
*
|
||||
* @param string Component key (eg: blog)
|
||||
* @param string Êëþ÷ êîìïîíåíòà (íàïð-ð: blog)
|
||||
* @return void
|
||||
*/
|
||||
function acp_component_disable( $key )
|
||||
@@ -524,10 +539,10 @@ class api_components extends api_core
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Components Rebuild Cache
|
||||
// Ïåðåñòðîéêà êåøà êîìïîíåíòîâ
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Rebuild cache
|
||||
* Ñîçäàåò íîâûé êåø êîìïîíåíòîâ
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user